Skip to main content

Change a supply exchange rate

This method allows a TEOS user to update the exchange rate of an existing supply. Supply represents an offer created by a user to trade a specific amount of one asset for a specific amount of another asset. By changing the exchange rate, the user can adjust the amount of desired asset received per unit of offered asset for that supply.

📘 Learn more about supplies.

Request Endpoint:​

POST
/odata/v1.0/Supplies({key})/ChangeExchangeRate

Parameters​

NameDescription
keystring (path) — The unique identifier of the supply to update. Example: 0x1EAEFD42D684567ABDC7000193A96C4653DE1314DB20000167242CB20000024E

Request Body​

application/json

FieldTypeDescription
exchangeRatestringThe new exchange rate for the supply, representing the amount of desired asset per 1 spark of offered asset.

Example Request​

POST /Supplies('0x1EAEFD42D684567ABDC7000193A96C4653DE1314DB20000167242CB20000024E')/ChangeExchangeRate

Content-Type: application/json

{
"exchangeRate": "1"
}

Example Response Body​

{
"Id": "C0D34D73-6FD3-40F2-A7E1-08D9412448F7",
"State": "3",
"BlockchainTransactionId": "0x748ac47e7226cae0e4e13373375f33ab9e4d43ef29d85d233162a7e7e913703b",
"CorrelationId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"Type": "ActivateAsset",
"OnCreated": "2025-10-08T09:36:47.978Z",
"OnUpdated": "2025-10-08T09:36:47.978Z",
"OnSubmitted": "2025-10-08T09:36:47.978Z",
"OnCommitted": "2025-10-08T09:36:47.978Z",
"OnConfirmed": "2025-10-08T09:36:47.978Z",
"OnRevokedByBlockchain": "2025-10-08T09:36:47.978Z",
"OnRevokedByUser": "2025-10-08T09:36:47.978Z",
"OnRevokedByTxServer": "2025-10-08T09:36:47.978Z",
"SignedBy": "string",
"CreatedBy": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"GasPrice": "string",
"GasUsed": "string",
"DataAsJson": "string",
"SigningParametersAsJson": "string"
}

Response Body Fields Description​

FieldTypeDescription
IdstringTransaction ID of the exchange rate update.
StatestringCurrent state of the transaction.
BlockchainTransactionIdstringID of the transaction on blockchain.
CorrelationIdstringCorrelation ID for tracking the transaction.
TypestringType of the transaction.
OnCreateddatetimeTimestamp when the transaction was created.
OnUpdateddatetimeTimestamp when the transaction was last updated.
OnSubmitteddatetimeTimestamp when the transaction was submitted.
OnCommitteddatetimeTimestamp when the transaction was committed.
OnConfirmeddatetimeTimestamp when the transaction was confirmed.
OnRevokedByBlockchaindatetimeTimestamp if the transaction was revoked by blockchain.
OnRevokedByUserdatetimeTimestamp if the transaction was revoked by user.
OnRevokedByTxServerdatetimeTimestamp if the transaction was revoked by transaction server.
SignedBystringIdentifier of the signer.
CreatedBystringIdentifier of the creator.
GasPricestringGas price used in the transaction.
GasUsedstringGas used by the transaction.
DataAsJsonstringAdditional transaction data in JSON.
SigningParametersAsJsonstringParameters used for signing the transaction.

Responses​

CodeDescription
201The transaction was successfully created.
202Accepted. The exchange rate change transaction has been submitted.
400The supplied exchange rate data is invalid. Error details are included.
401Unauthorized.