Skip to main content
POST
TypeScript

Authorizations

Authorization
string
header
required

The Venue key (trdrs_vk_sandbox_… or trdrs_vk_production_…), in preview. It belongs to one venue in one environment and carries the scopes it was created with. The venue's verified owner creates it while signed in. It works on the /api/venues/{venueId} routes and, with trader:read or trader:trade, on the account, market and trading routes, reading the venue's own traders' accounts and routing their orders, each request naming its trader in x-trdrs-trader. A trdrs_sk_… key can't be used in its place. It reaches its venue's routes and its venue's own traders, and the owner manages keys from a signed-in session. Keep it on your server.

Headers

Idempotency-Key
string
required

Your reference for this operation, 1 to 128 characters. It is recorded before any money moves, so a retry with the same key is refused as duplicate_reference and moves nothing a second time. Read the result by this reference with the balance receipt route, which reads every reference this write accepts.

Required string length: 1 - 128

Path Parameters

venueId
string<uuid>
required
accountId
string
required

Body

application/json
op
enum<string>
required

credit adds money, debit takes it away, and adjustment records a correction.

Available options:
credit,
debit,
adjustment
amount
number
required

A positive amount in the account currency, at most 1,000,000,000, with no more decimals than the currency posts in.

comment
string | null

An optional note kept with the record, at most 300 characters.

Maximum string length: 300

Response

Success. The response is sent with Cache-Control: no-store, so don't cache it.

recorded
any
required
accountId
string
required
op
enum<string>
required
Available options:
credit,
debit,
adjustment
amount
string
required

An exact decimal string, such as "12.5", with at most 18 digits after the point and no exponent.

currency
string
required
referenceId
string
required