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
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | true | Test order ID. |
Body parameters
| Name | Type | Required | Description |
|---|---|---|---|
| currencyFrom | string | false | Ticker of the payin currency in uppercase. |
| currencyTo | string | false | Ticker of the payout currency in uppercase. |
| amountFrom | string | false | Amount of currency the user is going to pay. |
| country | string | false | 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. |
| walletAddress | string | false | Recipient wallet address. |
| walletExtraId | string | false | Property required for wallet addresses of currencies that use an additional ID for transaction processing (XRP, XLM, EOS, BNB). |
| refundAddress | string | false | Recipient refund address. |
| paymentMethod | string | false | The payment method code. Possible values |
| userAgent | string | false | User Agent. |
| metadata | object | false | Metadata object, which can contain any parameters you need. |
| status | string | false | Test order status. Possible values |
| amountTo | string | false | Amount of currency the user is going to send. |
| payinAmount | string | false | Payin amount. |
| payoutAmount | string | false | Estimated payout amount. |
| payinCurrency | string | false | Ticker of the payin currency. |
| payoutCurrency | string | false | Ticker 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
| Name | Type | Required | Description |
|---|---|---|---|
| redirectUrl | string | true | URL to the provider's purchase page. |
| returnSuccessUrl | string | false | Return URL after a successfully completed transaction. |
| returnFailedUrl | string | false | Return URL after a failed transaction. |
| orderId | string | true | Internal order ID provided by Fiat API. |
| externalUserId | string | true | User ID provided by you. |
| externalOrderId | string | true | Order ID provided by you. |
| type | string | true | Order type. Enum: buy/sell. |
| providerCode | string | true | The On-Ramp or Off-Ramp provider code. Possible values. |
| currencyFrom | string | true | Ticker of the payin 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. Required if the provided country is US. |
| ip | string | true | User's IP address. |
| walletAddress | string | true | Recipient wallet address. |
| walletExtraId | string | true | Property required for wallet addresses of currencies that use an additional ID for transaction processing (XRP, XLM, EOS, BNB). |
| refundAddress | string | true | Recipient refund address. |
| paymentMethod | string | true | The payment method code. Possible values. |
| userAgent | string | true | User Agent. |
| metadata | object | true | Metadata object, which can contain any parameters you need:
|
| createdAt | date-time | true | Time in ISO 8601 format. |
| status | string | true | Test order status. Possible values |
| payinAmount | string | true | Payin amount. |
| payoutAmount | string | true | Estimated payout amount. |
| payinCurrency | string | true | Ticker of the payin currency. |
| payoutCurrency | string | true | Ticker of the payout currency. |
| updatedAt | date-time | true | Time 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:
| Type | Description |
|---|---|
| validation | Validation error. The request does not match the schema. |
| txType | The id parameter contains the ID of a production transaction. |
| status | The test transaction already has the set status. |
The errorDetails item schema:
| Name | Type | Required | Description |
|---|---|---|---|
| cause | string | true | Error cause. |
| value | string | true | Error value. |
Error codes
| Code | Message |
|---|---|
| 400 | BadRequest |
| 401 | Unauthorized |
| 403 | Forbidden |
| 410 | Offer expired |
| 422 | Unprocessable entity |
| 429 | TooManyRequests |
| 500 | InternalServerError |
- 400
- 401
- 403
- 410
- 422
- 429
- 500
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"
}
]
}
Unauthorized
{
"errorType": "unauthorized",
"errorMessage": "Unauthorized",
"errorDetails": null
}
Forbidden
{
"errorType": "forbidden",
"errorMessage": "Forbidden",
"errorDetails": null
}
Offer expired
{
"errorType": "offerExpired",
"errorMessage": "Offer expired",
"errorDetails": null
}
Unprocessable entity
{
"errorType": "unprocessableEntity",
"errorMessage": "Unprocessable entity",
"errorDetails": null
}
TooManyRequests
{
"errorType": "tooManyRequests",
"errorMessage": "Too many requests",
"errorDetails": null
}
InternalServerError
{
"errorType": "internalServerError",
"errorMessage": "Internal Server Error",
"errorDetails": null
}