WalletD developers
Postings

Post one balanced transaction

Posts one balanced transaction: legs in integer minor units that sum to zero per commodity, or nothing is written at all.

POST/v1/ledgers/{ledgerId}/postings

Posts one balanced transaction: legs in integer minor units that sum to zero per commodity, or nothing is written at all. Requires an Idempotency-Key; a replay within the retention window returns the original response byte for byte and posts nothing further. The whole refusal vocabulary is checked inside this one database transaction, under the accounts' own locks: unbalanced and invalid for a request the books could never take, insufficient_funds when a leg would breach an account's floor, account_frozen / account_closed, precondition_failed when a supplied version_is or min_available_after no longer holds, limit_exceeded when a limit_claims entry would push its aggregate past max, period_closed when effective_at falls inside a closed period, and post_exceeds_pending when post_pending_id is set and the debits exceed what that pending reserved. Claims and preconditions are consumed and checked in the same transaction as the money, which is what makes a cross-request cap authoritative here rather than advisory in the caller.

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

ledgerId*string
Formatuuid

Header Parameters

Idempotency-Key*string

Replays return the original response byte-identically within the retention window.

Length1 <= length <= 255

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

curl -X POST "https://example.com/v1/ledgers/497f6eca-6276-4993-bfeb-53cbbbba6f08/postings" \  -H "Idempotency-Key: string" \  -H "Content-Type: application/json" \  -d '{    "type": "string",    "legs": [      {        "account_id": "449e7a5c-69d3-4b8a-aaaf-5c9b713ebc65",        "direction": "credit",        "amount": 1,        "commodity": "string"      },      {        "account_id": "449e7a5c-69d3-4b8a-aaaf-5c9b713ebc65",        "direction": "credit",        "amount": 1,        "commodity": "string"      }    ]  }'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "type": "string",  "status": "string",  "reference_id": "97c1ff22-6e4f-4821-b1d3-5236781d37b8",  "metadata": {    "property1": "string",    "property2": "string"  },  "exchange_id": "6e73ee7b-fdf3-44c2-947d-260c3ee72506",  "reverses_txn_id": "5b70dad8-f43f-45eb-afbd-821f57facc93",  "reversed_by": "69b6d93a-63e5-4842-b5ef-0ace8f62b2a4",  "legs": [    {      "owner_type": "string",      "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05",      "purpose": "string",      "direction": "credit",      "amount": 0,      "commodity": "string"    }  ],  "effective_at": "2019-08-24T14:15:22Z",  "created_at": "2019-08-24T14:15:22Z"}