Post a transaction in your Blnk Ledger.
curl --request POST \
--url http://localhost:5001/transactions \
--header 'X-blnk-key: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"amount": 1250.34,
"currency": "USD",
"precision": 100,
"reference": "ref_2ye281ewiu-1e17-dh17-eh18728hd245",
"source": "@WorldUSD",
"destination": "@MyBalance",
"description": "Fund with starting balance amount",
"meta_data": {}
}'
{
"amount": 1250.34,
"rate": 0,
"precision": 100,
"precise_amount": 125034,
"transaction_id": "txn_c4e70eb8-e4d6-4e04-a2e2-92a43b969e0c",
"parent_transaction": "",
"source": "bln_f344b673-e855-4bda-b769-3e94a02c1941",
"destination": "bln_d5cbde84-d20a-485b-8ce8-6677d782c3a1",
"reference": "ref_2ye281ewiu-1e17-dh17-eh18728hd245",
"currency": "USD",
"description": "Card payment on Stripe",
"status": "QUEUED",
"hash": "0b9c25fb5b00d6c71cb4ca87026bf6dc316e63353d3330deb588bd0b3d74dcc0",
"allow_overdraft": false,
"inflight": false,
"created_at": "2024-11-26T09:33:35.265582042Z",
"scheduled_for": "0001-01-01T00:00:00Z",
"inflight_expiry_date": "0001-01-01T00:00:00Z"
}
X-blnk-key: <api-key>.
Replace <api-key> with your secret API key. Ensure the key is kept secure and not exposed in public repositories or client-side code.
See also: Secure your Blnk server
precise_amount instead. See also: Precision.@ prefix indicates that the balance is an internal balance.@ prefix indicates that the balance is an internal balance.+00:00 specifies the timezone. It is UTC by default.+00:00 specifies the timezone. It is UTC by default.true, it bypasses the default transaction queuing system and processes transactions directly. See also: Skip transaction queue.Show Lineage metadata (optional)
track_fund_lineage: true, you can tag incoming funds by setting a provider in metadata. Learn more: Fund lineage."stripe", "paypal", "treasury").amount x precision. Learn why this is important: Why use precisionSHA-256 hash of the transaction details. Learn more: Transaction hashingcurl --request POST \
--url http://localhost:5001/transactions \
--header 'X-blnk-key: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"amount": 1250.34,
"currency": "USD",
"precision": 100,
"reference": "ref_2ye281ewiu-1e17-dh17-eh18728hd245",
"source": "@WorldUSD",
"destination": "@MyBalance",
"description": "Fund with starting balance amount",
"meta_data": {}
}'
{
"amount": 1250.34,
"rate": 0,
"precision": 100,
"precise_amount": 125034,
"transaction_id": "txn_c4e70eb8-e4d6-4e04-a2e2-92a43b969e0c",
"parent_transaction": "",
"source": "bln_f344b673-e855-4bda-b769-3e94a02c1941",
"destination": "bln_d5cbde84-d20a-485b-8ce8-6677d782c3a1",
"reference": "ref_2ye281ewiu-1e17-dh17-eh18728hd245",
"currency": "USD",
"description": "Card payment on Stripe",
"status": "QUEUED",
"hash": "0b9c25fb5b00d6c71cb4ca87026bf6dc316e63353d3330deb588bd0b3d74dcc0",
"allow_overdraft": false,
"inflight": false,
"created_at": "2024-11-26T09:33:35.265582042Z",
"scheduled_for": "0001-01-01T00:00:00Z",
"inflight_expiry_date": "0001-01-01T00:00:00Z"
}
Was this page helpful?
curl --request POST \
--url http://localhost:5001/transactions \
--header 'X-blnk-key: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"amount": 1250.34,
"currency": "USD",
"precision": 100,
"reference": "ref_2ye281ewiu-1e17-dh17-eh18728hd245",
"source": "@WorldUSD",
"destination": "@MyBalance",
"description": "Fund with starting balance amount",
"meta_data": {}
}'
{
"amount": 1250.34,
"rate": 0,
"precision": 100,
"precise_amount": 125034,
"transaction_id": "txn_c4e70eb8-e4d6-4e04-a2e2-92a43b969e0c",
"parent_transaction": "",
"source": "bln_f344b673-e855-4bda-b769-3e94a02c1941",
"destination": "bln_d5cbde84-d20a-485b-8ce8-6677d782c3a1",
"reference": "ref_2ye281ewiu-1e17-dh17-eh18728hd245",
"currency": "USD",
"description": "Card payment on Stripe",
"status": "QUEUED",
"hash": "0b9c25fb5b00d6c71cb4ca87026bf6dc316e63353d3330deb588bd0b3d74dcc0",
"allow_overdraft": false,
"inflight": false,
"created_at": "2024-11-26T09:33:35.265582042Z",
"scheduled_for": "0001-01-01T00:00:00Z",
"inflight_expiry_date": "0001-01-01T00:00:00Z"
}