Posting

Create and post a purchase

QBO-style purchase endpoint for ordinary money-out transactions against a bank, cash, or credit-card account. Creates posted accounting immediately and creates a bank transaction when the source account is linked to a LedgerHQ bank account.

post/purchases

Request

  • Base URL: https://ledgerhq.pro/api/v1
  • URL: https://ledgerhq.pro/api/v1/purchases
  • Auth: one of:
    • HTTP bearer and API key in header x-organization-id
    • HTTP bearer and API key in header x-organization-id

Headers

Idempotency-Keystring required

Stable retry key for this posting request within the LedgerHQ organization.

Request body

paymentType'cash' | 'check' | 'credit_card' | 'bank_transfer' | 'other'
sourceAccountIdstring uuid required
datestring date required
amountCentsinteger required

Integer cents. Example: 1250 means $12.50.

categoryAccountIdstring uuid required
classIdstring uuid nullable

Optional class UUID from GET /classes; tags the income or expense line for Profit & Loss by Class

descriptionstring required
contactIdstring uuid nullable
taxRateIdstring uuid nullable
referencestring nullable
currencyCodestring
metadataobject

Response

Idempotent replay

Changes

No recorded changes to this operation across all 5 revisions of this API.