Settle payments to invoices — integration guide

This guide describes how an external system (for example a finance or ERP system) records invoice remittance in AlayaCare Residential, which is settling payments to invoices. It covers a single call that posts a manual transaction (a payment, write off or sales adjustment) and settles it to the invoice items you choose, for the amounts you choose.

Overview

A remittance is a payment received from or for a resident that is applied against an invoice. Use this endpoint when you want to choose exactly which invoice items are settled and by how much (including a partial settlement), and you do not want to create a deposit first.

Purpose Request Body Success response
Post a payment, write off or sales adjustment and settle it to invoice items POST …/api/Journals/Journal/CreateTransactionAndSettle CreateTransactionCriteria 200 OK with an empty body
  • Requests use application/json. Enumerations are sent as their numeric values.
  • Authenticate as described on the home page. The call requires write access to finance journals, and the caller must have access to the business unit of every invoice item being settled.
  • Journal types and transaction types referenced below are listed on the Journal Types and Transaction Types pages.
  • The call is only allowed in an open posting period.

Create a transaction and settle it — POST Journals/Journal/CreateTransactionAndSettle

POST …/api/Journals/Journal/CreateTransactionAndSettle creates a manual transaction journal and settles the selected invoice items to it in one call.

  • The body is a CreateTransactionCriteria. It must not be empty.
  • On success the service returns 200 OK with an empty body.
  • The invoice items can belong to more than one invoice and more than one business unit. One journal is created for each business unit.
  • The request is all or nothing: if any part fails, no journals are created and no invoice items are settled.
Request fields
Field Type Required Notes
journalTypeID integer Yes The journal type of the new journal. Use a journal type that supports the transactionTypeID you send; see the Journal Type X Transaction Types matrix.
transactionTypeID integer Yes The transaction type to post. Only 5 (Payment Made), 8 (Sales Adjustment) and 9 (Write Off) are accepted. See Transaction types you can post.
postingDate date-time Yes Date the transaction is posted. Must fall within an open posting period. It is also used as the journal item date.
invoiceItemSettlementAmounts dictionary (invoiceItemID → decimal amount) Yes The invoice items to settle. Each key is an invoiceItemID and each value is the amount to settle on that item. At least one entry with an ID above 0 and an amount above 0 is needed. Entries with a zero or negative amount are ignored. The amount must not be greater than the item’s outstandingAmount. Example: { "88231": 1200.00, "88232": 1250.00 }.
drawerName string Payment Made only Name of the person or entity the payment was drawn from. Required when transactionTypeID is 5 (Payment Made). Not required for a write off or sales adjustment.
paymentMethod integer No PaymentMethod numeric value: 10 Cash, 20 Cheque, 30 CreditCard, 40 DirectDebit, 50 EFT. Drives the cheque fields below. Intended for a payment made.
comments string No Free-text comment, applied to every journal item created.
payeeName, payeeAddress string No Name and address of the payee, carried onto the journal items.
isDepositSlip boolean No Defaults to false. Set to true to include the payment on the deposit slip.
chequeNumber, bankName, bankBranch string Cheque only See Conditionally required fields.
Conditionally required fields
Condition Rule
transactionTypeID = 5 (Payment Made) drawerName is required.
transactionTypeID = 9 (Write Off) or 8 (Sales Adjustment) drawerName is not required.
paymentMethod = Cheque (20) chequeNumber, bankName and bankBranch are all required.
paymentMethod is anything other than Cheque, or is not sent chequeNumber, bankName and bankBranch must be empty. The request is rejected if any of them has a value.

These are the only conditional rules. paymentMethod, payeeName, payeeAddress, comments and isDepositSlip are optional for every transaction type.

Transaction types you can post

Only the transaction types below can be posted with this call. Any other transactionTypeID, such as Deposit or Revenue, is rejected.

Transaction Type ID Code Description Use it to drawerName Receipt number
5 PM Payment Made Record cash, cheque, EFT or card received and apply it to invoice items. This is invoice remittance. Required Generated
9 WO Write Off Manually reduce what is owed on invoice items. There is no payment, so no payer details are needed. Not required Not generated
8 SA Sales Adjustment Manually reduce what is owed on invoice items as a sales adjustment. Not required Not generated

The transaction type must also be one that your journalTypeID supports. Read transactionTypeIDs from GET …/api/Billings/JournalTypes, or see the Journal Type X Transaction Types matrix.

Validation rules
  • postingDate must be in an open posting period.
  • Every invoiceItemID must exist and be active. If any one is not found, the whole request is rejected.
  • No amount may be greater than the outstandingAmount of its invoice item. The amount is checked against each item separately, not against the invoice.
  • The caller must have access to the business unit of every invoice item.
  • transactionTypeID must be 5, 8 or 9 (and must exist).
  • The cheque rules in Conditionally required fields must be met.
The total amount settled is the sum of the amounts in invoiceItemSettlementAmounts. There is no separate total field to send.
What the service creates
  • One journal for each business unit that owns the invoice items. Each journal is a manual journal of the journalTypeID you sent, with the description New Transaction, and is posted.
  • A pair of linked, posted journal items for each invoice item settled. Each item in the pair points at the other through referenceJournalItemID:
Journal item Transaction type Notes
Transaction side The transactionTypeID you sent (PM, WO or SA) Carries the payment details you sent (drawerName, paymentMethod, payee and cheque fields, comments). For PM a receipt number is generated.
Receivable side AR Accounts Receivable (ID 1) Offsets the transaction side and reduces what is owed on the invoice item.
  • The outstandingAmount of each invoice item, and of its invoice, is reduced by the amount settled.
  • GL codes for the journal items come from the GL codes configured on the transaction types.

Because the call has no response body, read the invoice (GET …/api/Invoices/Invoice/{invoiceID}) to see the result.

Example request — payment made

Records an EFT payment of $2,450.00 from a resident’s representative and applies it to two invoice items. drawerName is required because transactionTypeID is 5.

POST /api/Journals/Journal/CreateTransactionAndSettle
Content-Type: application/json

{
  "journalTypeID": 10001,
  "transactionTypeID": 5,
  "postingDate": "2026-10-29T00:00:00",
  "drawerName": "J. Citizen",
  "paymentMethod": 50,
  "comments": "Remittance REM-20261029-001",
  "invoiceItemSettlementAmounts": {
    "88231": 1200.00,
    "88232": 1250.00
  }
}

HTTP/1.1 200 OK

IDs are illustrative. Use the journal type ID from your own organization.

Cheque payment — send the cheque fields as well:

{
  "journalTypeID": 10001,
  "transactionTypeID": 5,
  "postingDate": "2026-10-29T00:00:00",
  "drawerName": "J. Citizen",
  "paymentMethod": 20,
  "chequeNumber": "004512",
  "bankName": "Example Bank",
  "bankBranch": "Sydney CBD",
  "isDepositSlip": true,
  "invoiceItemSettlementAmounts": { "88231": 1200.00 }
}
Example request — write off

Writes off $35.50 on one invoice item. drawerName and the payment fields are not sent.

POST /api/Journals/Journal/CreateTransactionAndSettle
Content-Type: application/json

{
  "journalTypeID": 10002,
  "transactionTypeID": 9,
  "postingDate": "2026-10-29T00:00:00",
  "comments": "Small balance write off",
  "invoiceItemSettlementAmounts": {
    "88240": 35.50
  }
}

HTTP/1.1 200 OK

Errors

Nothing is saved when the call fails. A failed call returns an error response that includes a message describing the cause.

Cause Message or behaviour
The body is missing, or fails field validation (400) For example a missing chequeNumber, bankName or bankBranch for a cheque, or cheque fields sent when paymentMethod is not Cheque.
invoiceItemSettlementAmounts is empty, or has no entry with an ID and an amount above 0 No invoice items with a positive settle amount.
postingDate is in a closed posting period Transaction cannot be posted, the posting period is closed.
An invoice item does not exist or is not active One or more invoice items could not be found.
An amount is greater than the outstanding amount of its invoice item Settle amount … exceeds outstanding amount … for invoice item …
transactionTypeID is not 5, 8 or 9 Transaction type '…' is not valid for a manual transaction. Allowed types: Payment Made, Write Off, Sales Adjustment.
transactionTypeID does not exist The transaction type is reported as not found.
The caller has no access to the business unit of an invoice item Access is denied.
The caller does not have write access to finance journals Access is denied.