Skip to main content
Create the on-chain transaction(s) for a distribution contract. The request body is a discriminated union keyed on action — each action requires a different set of fields. Route: POST /api/external/v1/transactions/create

Headers

HeaderRequiredDescription
Content-TypeYesMust be application/json
x-magna-api-tokenYesYour Magna API token

Body parameters

The action field selects the operation:

INITIALIZE

Initializes a distribution contract.
FieldTypeRequiredDescription
action"INITIALIZE"YesOperation type
contractIdstring (uuid)YesContract to initialize
adminWalletIdstring (uuid)YesAdmin wallet that will sign

START_DISTRIBUTION

Starts (and funds) a distribution for the given allocations.
FieldTypeRequiredDescription
action"START_DISTRIBUTION"YesOperation type
contractIdstring (uuid)YesContract the allocations belong to
tokenIdstring (uuid)YesToken of the allocations
allocationIdsstring[] (uuid)YesAllocations to start (min 1)
adminWalletIdstring (uuid)NoAdmin wallet that will sign
fundTillstring (ISO date)NoFund the distribution up to this date
memostringNoOptional memo

FUND_DISTRIBUTION

Funds a direct-transfer distribution.
FieldTypeRequiredDescription
action"FUND_DISTRIBUTION"YesOperation type
tokenIdstring (uuid)YesToken of the allocations
dataarrayYesList of { allocationId, amount } (min 1)
data[].allocationIdstring (uuid)YesAllocation to fund
data[].amountnumberYesAmount to fund (positive)
isTestbooleanNoRun as a test transaction

Request example

curl -X POST https://app.magna.so/api/external/v1/transactions/create \
-H 'Content-Type: application/json' \
-H 'x-magna-api-token: YOUR_API_KEY' \
-d '{
  "action": "START_DISTRIBUTION",
  "contractId": "c1...uuid",
  "tokenId": "b3...uuid",
  "allocationIds": ["a1...uuid", "a2...uuid"]
}'

Response example

{
  "transactions": [
    { "transactionId": "t1...uuid", "status": "PENDING" },
    { "transactionId": "t2...uuid", "status": "PENDING" }
  ]
}
Build the signable parameters for each returned transactionId with Transaction Signing Parameters, then track progress with Transaction Status.