Skip to main content

Create a supply

This method allows a TEOS user to create a new supply. A supply is an offer to exchange a specific amount of sparks of an offered asset for a specific amount of sparks of a desired asset.

📘 Learn more about supplies.

Request Endpoint:

POST/odata/v1.0/Supplies/Create

Sample Request

POST /Supplies/Create

Content-Type: application/json

In EVM-compatible networks (e.g., Sparknet, Ethereum, and Polygon), the "OriginatorAddress" and "ReceiverAddress" are 42 characters long. In non-EVM networks, the address length may differ. For example, on Internet Computer, it is 63 characters.

{
"OfferedAssetId" : "0x28fb9b1d9baf5cbf6aea0001",
"DesiredAssetId" :"0x564f0ffb29de16fba6e00001",
"OfferedSparksAmount" :"100",
"ExchangeRate": "1",
"OriginatorAddress" : "0xfa967924a46b687b27f9cb11dd6f7386f3b9a4ec",
"ReceiverAddress" : "0xfa967924a46b687b27f9cb11dd6f7386f3b9a4ec",
"TakeAll" : true,
"ExpirationDate":"2024-02-15T23:25:24.295Z",
"ExpirationBlock" : "84572310231845",
"CreatedBy": "70647697-15c6-454d-8b34-638c8f68c79f"
}

Parameters

NameDescription
NoneThis method does not require URL parameters

Request Body

FieldTypeDescriptionMandatory
OfferedAssetIdstringUnique identifier of the offered asset
DesiredAssetIdstringUnique identifier of the desired asset
OfferedSparksAmountstringAmount of offered asset in sparks
ExchangeRatestringAmount of desired asset per spark of offered asset
OriginatorAddressstringAddress of the issuer
ReceiverAddressstringAddress of the receiver
CreatedBystringIdentifier of the creator
ExpirationDatedatetimeExpiration date of the supply (mutually exclusive with ExpirationBlock)
ExpirationBlockstringBlock number when supply expires (mutually exclusive with ExpirationDate)
TakeAllbooleanWithdraw the whole amount at one iteration (default: false)

Example Response Body

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

Response Fields Description

FieldTypeDescription
IdstringIdentifier of the transaction
StatestringCurrent state of the transaction
BlockchainTransactionIdstringID of the transaction on blockchain
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 transaction was revoked by blockchain
OnRevokedByUserdatetimeTimestamp if transaction was revoked by user
OnRevokedByTxServerdatetimeTimestamp if transaction was revoked by transaction server
SignedBystringAddress or identifier of the signer
CreatedBystringIdentifier of the creator
GasPricestringGas price used in blockchain transaction
GasUsedstringGas consumed for transaction execution
DataAsJsonstringAdditional data in JSON format
SigningParametersAsJsonstringSigning parameters in JSON format

Responses

CodeDescription
200OK
201The transaction was successfully created
400The supply create data is invalid. Error details are included
401Unauthorized
404Not Found