Skip to main content
POST
/
transactions
curl -X POST "http://localhost:5001/transactions" \
  -H "X-blnk-key: <api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "precise_amount": 1905034,
    "currency": "USD",
    "precision": 100,
    "reference": "ref_2ye281ewiu-1e17-dh17-eh18728hd245",
    "sources": [
      {
        "identifier": "bln_f2073f6b-905a-4e3e-b5a2-8d1b3dc2fb7f",
        "distribution": "10%"
      },
      {
        "identifier": "bln_64c50fb5-32d5-4f78-9f4a-e8b01aaf025d",
        "precise_distribution": "500000"
      },
      {
        "identifier": "bln_7d98dfe9-5c3e-4c9b-b96a-65f6d9f7b89b",
        "distribution": "left"
      }
    ],
    "destination": "@WorldUSD",
    "meta_data": {}
  }'
{
    "amount": 19050.34,
    "precision": 100,
    "precise_amount": 1905034,
    "transaction_id": "txn_c4e70eb8-e4d6-4e04-a2e2-92a43b969e0c",
    "parent_transaction": "",
    "sources": [
      {
        "identifier": "bln_f2073f6b-905a-4e3e-b5a2-8d1b3dc2fb7f",
        "distribution": "10%"
      },
      {
        "identifier": "bln_64c50fb5-32d5-4f78-9f4a-e8b01aaf025d",
        "distribution": "5000"
      },
      {
        "identifier": "bln_7d98dfe9-5c3e-4c9b-b96a-65f6d9f7b89b",
        "distribution": "left"
      }
    ],
    "destination": "@WorldUSD",
    "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",
    "inflight_commit_date": "0001-01-01T00:00:00Z"
}
If you’re using the auto-provisioned Enterprise Core instance included with your Production License deployment, set the base URL to: https://ENTERPRISE_PUBLIC_URL/core.If you’re connecting to a different Core instance, use the publicly accessible base URL for that instance instead.

Authorization

If set, the API uses an API key for authentication. Include the following header in your requests: 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: Scoped API keys and Secure your Blnk server.

Body

Important tip: To apply multiple sources, Blnk uses the sources array instead of the conventional source parameter in Record transaction.
precise_amount
integer
The transaction amount in its smallest unit (recommended). Include the corresponding precision value. See Transaction precision.
Either precise_amount or amount should be provided, not both.
amount
integer | float
The transaction amount as a float. Blnk multiplies amount by precision to store precise_amount.
currency
string
required
The currency of the transaction amount is in.
precision
integer
default:"1"
required
Precision for the transaction’s currency. Also see: Precision.
reference
string
required
The unique transaction reference number for the transaction. If empty, Blnk auto-creates one.
sources
array
required
Lists the sources for the transaction. Each source includes:
destination
string
required
The balance receiving the amount. @ prefix indicates that the balance is an internal balance.
scheduled_for
string
Indicates the date and time of a scheduled transaction, e.g., "2024-02-20 05:28:03".
allow_overdraft
boolean
default:"false"
Specifies whether the transaction should proceed even if the source’s balance is insufficient. If enabled and the source has less than the required amount, the balance will become negative. See also: Overdrafts
inflight
boolean
default:"false"
Specifies that the transaction should be held until certain conditions are met. See also: Create inflight.
inflight_expiry_date
string
Specifies the date and time when an inflight transaction should expire. Once expired, the transaction is voided and the amount is rolled back.
inflight_commit_date
string
When inflight is true, the date and time when Blnk should automatically commit the inflight transaction. See Schedule inflight commits.
atomic
boolean
default:"false"
When false, Blnk processes each destination independently.Valid destinations are APPLIED, while invalid ones are REJECTED. When true, all destinations must succeed for the split to be processed. If any destination fails, no credits are APPLIED, and succesful inflights are set to VOID.See Atomic split processing.
meta_data
object
Additional metadata of the transaction.

Response

All parameters from the request body also mean the same in the corresponding response JSON.
precise_amount
integer
The amount stored in the ledger in its smallest unit. See Precision.
transaction_id
string
Unique id of the transaction.
parent_transaction
string
The transaction ID of the parent transaction. A parent transaction is one that impacts the creation of a new transaction, such as an inflight transaction, a scheduled transaction, or similar.For instance, refunding a sample transaction A creates a new transaction B; therefore A is the parent transaction of B.
status
string
The status of the transaction. See the following: Transaction statuses.
hash
string
Per-row SHA-256 fingerprint of the transaction’s core details. The optional global hash chain is separate and not returned in API responses. Learn more: Transaction hashing
created_at
string
Indicates the date & time the transaction was created.
meta_data
User Object
Additional metadata of the transaction.
curl -X POST "http://localhost:5001/transactions" \
  -H "X-blnk-key: <api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "precise_amount": 1905034,
    "currency": "USD",
    "precision": 100,
    "reference": "ref_2ye281ewiu-1e17-dh17-eh18728hd245",
    "sources": [
      {
        "identifier": "bln_f2073f6b-905a-4e3e-b5a2-8d1b3dc2fb7f",
        "distribution": "10%"
      },
      {
        "identifier": "bln_64c50fb5-32d5-4f78-9f4a-e8b01aaf025d",
        "precise_distribution": "500000"
      },
      {
        "identifier": "bln_7d98dfe9-5c3e-4c9b-b96a-65f6d9f7b89b",
        "distribution": "left"
      }
    ],
    "destination": "@WorldUSD",
    "meta_data": {}
  }'
{
    "amount": 19050.34,
    "precision": 100,
    "precise_amount": 1905034,
    "transaction_id": "txn_c4e70eb8-e4d6-4e04-a2e2-92a43b969e0c",
    "parent_transaction": "",
    "sources": [
      {
        "identifier": "bln_f2073f6b-905a-4e3e-b5a2-8d1b3dc2fb7f",
        "distribution": "10%"
      },
      {
        "identifier": "bln_64c50fb5-32d5-4f78-9f4a-e8b01aaf025d",
        "distribution": "5000"
      },
      {
        "identifier": "bln_7d98dfe9-5c3e-4c9b-b96a-65f6d9f7b89b",
        "distribution": "left"
      }
    ],
    "destination": "@WorldUSD",
    "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",
    "inflight_commit_date": "0001-01-01T00:00:00Z"
}

Need help?

We are very happy to help you make the most of Blnk, regardless of whether it is your first time or you are switching from another tool. To ask questions or discuss issues, please contact us or join our Discord community.