Skip to main content
POST
Add a transaction

Authorizations

Authorization
string
header
required

A group API key, sent as Authorization: Bearer sw_live_…. Keys from staging and the demo start sw_test_ instead. A group admin creates keys in Settings → Integrations → API keys.

Scopes

accounting:write

Headers

Idempotency-Key
string
required

Unique per transaction: any printable text up to 255 characters. A retry with the same key and body within 24 hours answers with the first transaction instead of making another. Required.

Required string length: 1 - 255

Body

application/json

With splits, the lines carry the category, budget, fund and Gift Aid, so leave those off the transaction. A field not listed here is refused with a 400.

date
string<date>
required

A date, YYYY-MM-DD.

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
type
enum<string>
required
Available options:
income,
expense
amount
string
required

Pounds, as a string with at most two decimal places: "12.50". Always positive: the type gives the direction.

Pattern: ^\d+(\.\d{1,2})?$
bankAccountId
string<uuid>
required

One of the group’s open bank accounts.

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
description
string
required

What the line is for. Stored, and returned only to a key with accounting.people:read.

Required string length: 1 - 500
categoryId
string<uuid> | null

One of the group’s categories. Another group’s id is refused with a 400.

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
reference
string | null

Stored, and returned only to a key with accounting.people:read.

Required string length: 1 - 255
counterparty
string | null

The payer or payee. Stored, and returned only to a key with accounting.people:read.

Required string length: 1 - 255
paymentMethod
enum<string> | null
Available options:
bank_transfer,
card,
cash,
cheque,
direct_debit,
other
sectionId
string<uuid> | null

One of the group’s sections. Another group’s id is refused with a 400.

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
eventId
string<uuid> | null

One of the group’s events. Another group’s id is refused with a 400.

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
memberId
string<uuid> | null

One of the group’s members. Another group’s id is refused with a 400.

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
restrictedFundId
string<uuid> | null

One of the group’s open restricted funds. Another group’s id is refused with a 400.

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
budgetId
string<uuid> | null

One of the group’s budgets. Another group’s id is refused with a 400.

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
isGiftAidEligible
boolean
giftAidType
enum<string> | null

How Gift Aid is claimed. Income lines only.

Available options:
declaration,
gasds,
manual
splits
object[]

At least two lines that add up to the amount, or none. Up to 50.

Maximum array length: 50
{key}
any

Response

The transaction an earlier request with the same Idempotency-Key made.

data
object
required