Skip to main content

Pay an invoice with transfer

Pays a specific Invoice using a direct transfer of the specified asset from the sender's address. The invoice represents a digital record of payment obligation, and this operation transfers the required asset amount (in sparks) to the invoice's target address.

📘 Learn more about invoices.

Request Endpoint​

POST /odata/v1.0/Invoices({key})/PayWithTransfer

Parameters​

ParameterTypeDescriptionMandatory
keystring($uuid)The unique identifier of the invoice to pay.✅

Request Body​

Content type: application/json — Specifies the sender address initiating the payment.

ParameterTypeDescriptionMandatory
senderAddressstringWallet address which will pay the invoice. Must have enough units of the asset.✅

Example Request​

POST /Invoices(68c6abdb-0650-46d5-7d33-08da44a68d8c)/PayWithTransfer

Content-Type: application/json

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

{
"senderAddress": "0xe0450ce1e2ef73b15514ae6a003b90d0ebac8835"
}

Response Body​

Content type: application/json — Returns details of the blockchain transaction created for invoice payment.

ParameterDescription
IdTransaction ID in TEOS system.
StateState of the transaction.
BlockchainTransactionIdID of the transaction on the blockchain.
CorrelationIdCorrelation ID for tracking across services.
TypeType of the transaction (e.g., ActivateAsset).
OnCreatedTimestamp when transaction was created.
OnUpdatedTimestamp when transaction was last updated.
OnSubmittedTimestamp when transaction was submitted to blockchain.
OnCommittedTimestamp when transaction was committed on blockchain.
OnConfirmedTimestamp when transaction was confirmed on blockchain.
OnRevokedByBlockchainTimestamp if transaction was revoked by blockchain.
OnRevokedByUserTimestamp if transaction was revoked by user.
OnRevokedByTxServerTimestamp if transaction was revoked by transaction server.
SignedByEntity that signed the transaction.
CreatedByID of the user who created the transaction.
GasPriceGas price used for the blockchain transaction.
GasUsedGas used by the blockchain transaction.
DataAsJsonAdditional transaction data in JSON format.
SigningParametersAsJsonJSON containing parameters used for signing.

Example Response Body​

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

Response Codes​

CodeDescription
202Invoice payment transaction accepted.
400Bad request, invalid data or insufficient asset balance.
401Unauthorized.
404Invoice not found.