Skip to main content
POST
/
transactions
Create transaction
curl --request POST \
  --url http://localhost:5001/transactions \
  --header 'X-blnk-key: <api-key>'
import requests

url = "http://localhost:5001/transactions"

headers = {"X-blnk-key": "<api-key>"}

response = requests.post(url, headers=headers)

print(response.text)
const options = {method: 'POST', headers: {'X-blnk-key': '<api-key>'}};

fetch('http://localhost:5001/transactions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_PORT => "5001",
CURLOPT_URL => "http://localhost:5001/transactions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-blnk-key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "http://localhost:5001/transactions"

req, _ := http.NewRequest("POST", url, nil)

req.Header.Add("X-blnk-key", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("http://localhost:5001/transactions")
.header("X-blnk-key", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("http://localhost:5001/transactions")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["X-blnk-key"] = '<api-key>'

response = http.request(request)
puts response.read_body
Use blnk.transactions.create to post a transaction between a source and destination balance.
1

Call the method

Move money from one source balance to one destination in a single call.
blnk.transactions.create
response = blnk.transactions.create({
  "precise_amount": 125034,
  "precision": 100,
  "currency": "USD",
  "source": "@WorldUSD",
  "destination": "@MyBalance",
  "reference": "ref_f482a1b3-6c2d-4e89-a17b-3d5e8f2a1c94",
  "description": "Customer payment",
  "allow_overdraft": False,
  "skip_queue": False,
})
FieldTypeDescription
precise_amountnumberAmount in minor units. Use with precision.
amountnumberFloat amount. Blnk applies precision. Use one of amount or precise_amount.
precisionnumberPrecision for the currency (for example 100 for cents).
currencystrCurrency of the transaction.
referencestrUnique reference for the transaction.
sourcestrBalance sending the amount. Prefix @ for an internal balance.
destinationstrBalance receiving the amount.
descriptionstrNarration of the transaction.
allow_overdraftboolAllow the source balance to go negative. See Overdrafts.
skip_queueboolBypass the transaction queue and process directly.
2

Response

201 Created
{
  "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_f482a1b3-6c2d-4e89-a17b-3d5e8f2a1c94",
  "currency": "USD",
  "description": "Customer payment",
  "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"
}
FieldTypeDescription
transaction_idstrUnique ID for the transaction.
statusstrTransaction status (for example QUEUED, APPLIED).
precise_amountnumberamount × precision.
sourcestrResolved source balance.
destinationstrResolved destination balance.
hashstrHash of the transaction details.
created_atstrDate and time the transaction was created.

How transactions work

Money movement, statuses, and the transaction lifecycle.

Create new transaction

HTTP request and response schema.

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.