Skip to main content
POST
Prepare a token approval
Prepares unsigned transactions for approving a spender to use tokens on behalf of the signer. Use POST /prepare-transactions with method=approve.

Fields

  • tokenSymbol selects the token being approved, not the asset it relates to.
  • spenderAddress is the address allowed to spend it. It is never derived — you must pass it.
  • tokenizerAddress is additionally required when tokenSymbol is a shared payment token (USDT, USDC, BKN, HAI). Use companyWalletAddress from GET /get-tokenizer-info.
  • amount is in whole tokens. Send "100" for 100 USDT; the API applies the token’s decimals for you. Do not pre-multiply.
spenderAddress is validated as an EVM address, and a malformed value is rejected with a validation error naming that field. Two things trip it most often: an invalid EIP-55 checksum, and leading or trailing whitespace picked up from a copied value or an environment variable. Trim the value, or send the address in all lowercase, which always passes the checksum rule.Sending the field as spender instead of spenderAddress returns Missing spender address parameter.

Choosing the spender

Allowances are per spender. An allowance granted to one contract gives nothing to another, so an investor who has invested in one offering still has to approve the next offering’s escrow separately. Both addresses come from the same call:

Approving payment tokens for dividend distributions

Before calling dividendDistribution, approve the tokenized asset’s configured payment token and set spenderAddress to the STO token contract address. Use the response fields as follows:
  • tokenAddressspenderAddress in the approve request
  • paymentTokenAddress → the ERC-20 contract being approved; use its configured symbol, such as USDT, as tokenSymbol
  • companyWalletAddresstokenizerAddress when approving a shared payment token
  • escrowAddressdo not use this as the spender for dividendDistribution
Approving the payment token to escrowAddress does not satisfy the dividend allowance check. The allowance must be from signerAddress to the STO tokenAddress.
For example, if get-tokenizer-info returns the STO address 0x2222222222222222222222222222222222222222 and the configured payment token is USDT:
Sign and submit the prepared approval, then wait for its on-chain confirmation before preparing dividendDistribution.

Replacing an existing allowance

Some payment tokens refuse to change a non-zero allowance directly. When the signer already has a non-zero allowance for that spender, the response therefore contains two transactions — a reset to 0 followed by the new amount — and txId is an array rather than a single value.
Iterate the array rather than assuming a single entry, and broadcast the transactions in order, waiting for the reset to confirm before sending the second.
Both transactions are gas-estimated at prepare time, while the reset is still unmined. On a token that strictly forbids a non-zero to non-zero change, that estimate can fail and the whole prepare call returns a revert with empty data ("data": "0x").If it does: check the current allowance with GET /get-allowance. If it already covers the amount you need, skip the approval entirely. Otherwise prepare and send amount: "0" on its own first, wait for it to confirm, then prepare the new amount.

Next step

Preparing does not touch the chain. The response gives you txId and an array of unsigned transactions — you still have to sign and submit them.
1

Sign every returned transaction

Sign each entry locally with the wallet that sends the transaction — signerAddress, or investorAddress for newInvest and claimTokens. It must be whitelisted by Brickken, and it needs native gas on the target chain.
2

Submit the signed payloads

POST them to /send-transactions as { txId, signedTransactions } and Brickken broadcasts for you.If you would rather broadcast yourself, prepare with executionMode: "client-broadcast" and confirm afterwards with { txId, txHash } instead.
3

Poll until it confirms

Call GET /get-transaction-status with the txId. A pending status means it is broadcast but not yet mined — do not resubmit.
Full walkthrough: Tokenize an asset and run an STO.

Authorizations

x-api-key
string
header
required

Body

application/json
method
enum<string>
default:approve
required

Required. Operation to prepare. Must be approve for this endpoint.

Available options:
approve
Example:

"approve"

chainId
string
required

Required. Blockchain network identifier. Hex format is recommended, for example Sepolia aa36a7.

Example:

"aa36a7"

signerAddress
string
required

Required. Wallet that signs the approval.

Example:

"0x742d35Cc6634C0532925a3b844Bc454e4438f44e"

tokenSymbol
string
required

Required. Symbol of the token to approve. Accepts a tokenized asset symbol or a payment token symbol such as USDT, USDC, BKN or HAI.

Example:

"EXMPL"

spenderAddress
string
required

Required. Address allowed to spend the approved amount. Allowances are per spender, so each offering's escrow must be approved separately. For an investment, use that offering's escrowAddress. For a payment-token approval before dividendDistribution, use the STO tokenAddress returned by GET /get-tokenizer-info; never use escrowAddress for that allowance. A malformed value is rejected with a validation error naming this field; whitespace and a bad EIP-55 checksum are the usual causes.

Pattern: ^0x[a-fA-F0-9]{40}$
Example:

"0x2222222222222222222222222222222222222222"

amount
string
required

Required. Amount the spender is allowed to spend, in whole tokens. The API applies the token's decimals, so send 100 for 100 USDT rather than the raw six-decimal value.

Example:

"100"

investorAddress
string

Optional. Token owner address when approving on behalf of an investor. If omitted, signerAddress is used as the owner.

Pattern: ^0x[a-fA-F0-9]{40}$
Example:

"0x1111111111111111111111111111111111111111"

tokenizerEmail
string<email>

Optional. Tokenizer email used as a fallback when the tokenizer cannot be resolved from the token.

Example:

"tokenizer@example.com"

tokenizerAddress
string

Optional. Required when tokenSymbol is a payment token (HAI, BKN, USDC, USDT). Tokenizer wallet the approval is scoped to; use companyWalletAddress from GET /get-tokenizer-info for the related tokenized asset.

Pattern: ^0x[a-fA-F0-9]{40}$
Example:

"0x1111111111111111111111111111111111111111"

Response

200 - application/json

Successful response

transactions
object[]
required

Array of unsigned transaction objects ready for signing

txId
string
required

Unique identifier for this transaction batch (required for /send-transactions). This is NOT a blockchain transaction hash.

Example:

"0x46adea7bdf49c576a760102e0d6bc9ecd650b3998588cd3d7f576a7973426aad"

info
object

Metadata about the operation