Skip to main content
POST
/
transactions
Create transaction
curl --request POST \
  --url http://localhost:5001/transactions \
  --header 'X-blnk-key: <api-key>'
Use client.Transaction.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.
client.Transaction.Create
transaction, resp, err := client.Transaction.Create(
	blnkgo.CreateTransactionRequest{
		ParentTransaction: blnkgo.ParentTransaction{
			PreciseAmount: big.NewInt(125034),
			Precision: 100,
			Currency: "USD",
			Source: "@WorldUSD",
			Destination: "@MyBalance",
			Reference: "ref_f482a1b3-6c2d-4e89",
			Description: "Customer payment",
			SkipQueue: false,
		},
		AllowOverdraft: false,
	},
)
FieldTypeDescription
PreciseAmount*big.IntAmount in minor units. Use with Precision.
Amountfloat64Float amount. Blnk applies Precision. Use one of Amount or PreciseAmount.
Precisionint64Precision for the currency (for example 100 for cents).
CurrencystringCurrency of the transaction.
ReferencestringUnique reference for the transaction.
SourcestringBalance sending the amount. Prefix @ for an internal balance.
DestinationstringBalance receiving the amount.
DescriptionstringNarration of the transaction.
AllowOverdraftboolAllow the source balance to go negative. See Overdrafts.
SkipQueueboolBypass 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_idstringUnique ID for the transaction.
statusstringTransaction status (for example QUEUED, APPLIED).
precise_amountnumberamount × precision.
sourcestringResolved source balance.
destinationstringResolved destination balance.
hashstringHash of the transaction details.
created_atstringDate and time the transaction was created.
Use transaction.TransactionID and other fields on the returned *blnkgo.Transaction struct.

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.