APG PayAPG Paydocs

Loans

Create loan transactions

POST/loan-transactions

Post a fee or an adjustment to a loan. Answers with the movement, or with the loan's balances where the entry was a standalone fee.

Permissions

Required permission
loanTransactions:create

Requires the `create` action on `loanTransactions` for the supplied runtime context

Request body

This body is a tagged shape: type is always "LtxnCmdPostManual". Send it; more variants can be added, and a caller that switches on it keeps working when they are.

Discriminated by type
type = "LtxnCmdPostManual"
loanIdLoanIdrequired

Identifier of a loan.

Example loan_9f2Kd8QpLzXw

How much moves. Positive draws down, negative credits back. Must be in the loan's own currency.

The line this puts on the borrower's statement.

curl -X POST https://api.tst.au.apgpay.dev/loan-transactions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "LtxnCmdPostManual",
  "loanId": "loan_9f2Kd8QpLzXw",
  "amount": {
    "type": "IsoCurrencyAmount",
    "minorCurrencyUnits": 1250,
    "currency": "AUD"
  },
  "lineItem": {
    "type": "LtxnLineItemEntryAttributes",
    "entryType": "Charge",
    "description": "string",
    "amounts": {
      "type": "LstmtEntryAmountsAttributes",
      "currency": "AUD",
      "total": 1250,
      "tax": 1250,
      "net": 1250
    },
    "taxRate": 0.9412,
    "taxType": "string"
  }
}'

Responses

The response is a typed union.

Discriminated by type
type = "LtxnCreateRspFee"

The loan's balances after the fee went on.

Example
{
  "type": "LtxnCreateRspFee",
  "balances": {
    "type": "LoanBalancesAttributes",
    "currency": "AUD",
    "limit": 500000,
    "used": 1250,
    "available": 1250,
    "reserved": 1250,
    "pending": 1250
  }
}

Error responses