Create and record a new transaction to move funds between balances. This endpoint supports simple transfers, multi-destination distributions, inflight transactions, and scheduled transactions.
Request Body
Transaction amount in major currency units (e.g., 100.50 for $100.50). Either amount or precise_amount must be provided, but not both. Note: For amounts with more than 15 significant digits, use precise_amount to avoid rounding errors.
Transaction amount in minor units as a string representing a big integer (e.g., “10050” for $100.50 with precision 100). Use this field for:
High precision amounts (>15 significant digits)
Avoiding floating-point rounding errors
Cryptocurrency transactions with large precision values
Unique reference identifier for this transaction. Used for idempotency - duplicate references will be rejected.
Three-letter ISO currency code (e.g., “USD”, “EUR”, “BTC”).
Human-readable description of the transaction.
Source balance ID from which funds will be debited. Either source or sources must be provided, but not both. Special Indicators:
Prefix with @ to use balance indicators (e.g., @world for external funds)
@world balances are automatically created if they don’t exist
Destination balance ID to which funds will be credited. Either destination or destinations must be provided, but not both.
Array of destination distributions for splitting credits across multiple balances. See Distribution Structure .
Precision multiplier for amount calculations (e.g., 100 for 2 decimal places, 1000 for 3 decimal places). Must be an integer value. If not provided, uses the balance’s currency multiplier.
Exchange rate for currency conversion transactions.
Whether to allow the source balance to go negative.
Maximum allowed negative balance when allow_overdraft is true.
Create as an inflight (pending) transaction. Inflight transactions reserve funds but don’t finalize the transfer until committed. Use cases:
Card authorizations
Pending payments
Multi-stage transactions
ISO 8601 timestamp when the inflight transaction should expire (e.g., “2024-04-22T15:28:03+00:00”).
ISO 8601 timestamp for when the transaction should be processed (e.g., “2024-04-22T15:28:03+00:00”). Scheduled transactions remain in SCHEDULED status until processed.
Process transaction synchronously without queuing. Use for high-priority transactions that need immediate processing.
Ensure all related transactions (e.g., distributions) succeed or fail together.
ISO 8601 timestamp for the transaction’s effective date for accounting purposes.
Custom key-value pairs for storing additional transaction information.
Distribution Structure
For multi-destination transactions, use the sources or destinations array with Distribution objects:
{
"identifier" : "bal_abc123" ,
"distribution" : "50%" , // or "100" for fixed amount, or "left" for remainder
"precise_distribution" : "1000" // Optional: fixed amount in minor units
}
Balance ID to debit/credit in this distribution.
distribution.distribution
Distribution method:
Percentage: "50%" - percentage of total amount
Fixed amount: "100" - fixed amount in major units
Remainder: "left" - receives remaining amount after other distributions
distribution.precise_distribution
Fixed distribution amount in minor units. Takes precedence over distribution for fixed amounts.
Response
Unique identifier for the created transaction.
ID of parent transaction if this is part of a distribution.
Transaction amount in major units.
Transaction amount in minor units (big integer).
String representation of the amount for display purposes.
Precision multiplier used for this transaction.
Transaction status:
QUEUED - Pending processing
APPLIED - Successfully processed
SCHEDULED - Scheduled for future processing
INFLIGHT - Pending commitment
REJECTED - Failed validation or processing
Cryptographic hash of the transaction for integrity verification.
Whether overdraft was allowed.
Whether this is an inflight transaction.
ISO 8601 timestamp when inflight transaction expires.
Source distributions with assigned transaction IDs.
Destination distributions with assigned transaction IDs.
ISO 8601 timestamp when transaction was created.
ISO 8601 timestamp for scheduled processing.
ISO 8601 timestamp of effective date.
Simple Transaction
Inflight Transaction
Multi-Destination Transaction
{
"transaction_id" : "txn_a1b2c3d4e5f6" ,
"source" : "bln_src123" ,
"destination" : "bln_dst456" ,
"reference" : "order-12345" ,
"amount" : 100.50 ,
"precise_amount" : "10050" ,
"precision" : 100 ,
"currency" : "USD" ,
"description" : "Payment for order #12345" ,
"status" : "APPLIED" ,
"hash" : "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08" ,
"allow_overdraft" : false ,
"inflight" : false ,
"created_at" : "2024-01-15T10:30:00Z" ,
"meta_data" : {
"customer_id" : "cust_123"
}
}
cURL
Request Body - Simple
Request Body - High Precision
Request Body - Inflight
Request Body - Multi-Destination
Request Body - Scheduled
curl -X POST https://api.blnkfinance.com/transactions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"amount": 100.50,
"reference": "order-12345",
"currency": "USD",
"description": "Payment for order #12345",
"source": "bln_src123",
"destination": "bln_dst456",
"precision": 100
}'
Precision Handling
Blnk uses big.Int internally for all amount calculations to ensure precise arithmetic without floating-point errors.
Amount vs PreciseAmount
amount: Floating-point number in major units (e.g., 100.50)
Converted internally: precise_amount = amount × precision
Limited to ~15 significant digits due to float64 precision
Suitable for most fiat currency transactions
precise_amount: String representing exact minor units (e.g., "10050")
No conversion needed - used directly as big.Int
Supports unlimited precision
Required for cryptocurrency and high-precision scenarios
Example
For $100.50 with precision 100:
Using amount: {"amount": 100.50, "precision": 100} → precise_amount = "10050"
Using precise_amount: {"precise_amount": "10050", "precision": 100} → Direct use
Transaction Lifecycle
Regular Transactions
QUEUED → Transaction created and queued for processing
APPLIED → Transaction successfully processed and balances updated
Scheduled Transactions
SCHEDULED → Transaction created with future scheduled_for date
QUEUED → Transaction becomes due and queued for processing
APPLIED → Transaction processed
Inflight Transactions
INFLIGHT → Transaction created with funds reserved
APPLIED → Transaction committed (see Update Inflight )
VOID → Transaction voided and funds released
Error Responses
Error message describing what went wrong.
Validation errors from request body.
Common Errors
400 Bad Request - Invalid request body or validation failure
Duplicate reference
Missing required fields
Invalid precision (must be integer)
Both amount and precise_amount provided
Neither amount nor precise_amount provided
Amount has >15 significant digits without using precise_amount
Both source and sources provided
Neither source nor sources provided
400 Bad Request - Business logic errors
Insufficient balance
Source/destination balance not found
Invalid distribution (total >100% or >amount)
Overdraft not allowed