Skip to main content

Create units for an asset

This endpoint allows you to create units for an existing asset on the blockchain. The amount of units can be provided either in natural units or in Sparks. The transaction is created for the address of the asset issuer (the Author field in the Asset model). The transaction must be signed by the asset issuer to complete this action.

📘 Learn more about natural units of measure and Sparks.

Preconditions:​

  • The asset with the provided uniqueAssetId must exist.
  • The amount of units must be a positive integer.
  • Amount should be provided as a string; it will be parsed to BigInteger during execution.

Request Endpoint:​

POST /odata/v1.0/Assets({key})/CreateUnits

Request Body:​

application/json — The object specifying the units to create.

ParameterTypeDescriptionMandatory
amountBodyAmount of units to create (as string)✅
typeBodyType of amount: "Sparks" or "Units"✅

Example Request Body:​

{
"amount": "2000",
"type": "Sparks"
}

Response Body:​

application/json — Returns the transaction object for the unit creation request.

ParameterDescription
IdThe transaction ID.
StateThe current state of the transaction.
BlockchainTransactionIdThe blockchain transaction hash.
CorrelationIdCorrelation ID for tracking.
TypeTransaction type (e.g., "ActivateAsset").
OnCreatedTimestamp when the transaction was created.
OnUpdatedTimestamp of last update.
OnSubmittedTimestamp when transaction was submitted.
OnCommittedTimestamp when transaction was committed.
OnConfirmedTimestamp when transaction was confirmed.
OnRevokedByBlockchainTimestamp if revoked by blockchain.
OnRevokedByUserTimestamp if revoked by user.
OnRevokedByTxServerTimestamp if revoked by transaction server.
SignedByAddress of signer.
CreatedByID of the creator.
GasPriceGas price for transaction.
GasUsedGas used for transaction.
DataAsJsonAdditional data in JSON format.
SigningParametersAsJsonSigning parameters in JSON format.

Example Response Body:​

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

Response Codes:​

CodeDescription
202The unit creation transaction was successfully placed.
400The request is invalid. Error details are included.
401Unauthorized