APG PayAPG Paydocs

Loans

Update loan

PATCH/loans/{loanId}

Update a loan's mutable attributes, including its status and its limit, or replace or clear its statement settings. Answers with the loan, and with the statement settings where the patch changed them.

11 actionsLoanUpdateAccountNameLoanUpdateBillingSourceLoanUpdateClearStatementSettingsLoanUpdateDisableLoanUpdateEnableLoanUpdateMetadataLoanUpdateProductLineLoanUpdateRealtimeSettlementLoanUpdateReferenceLoanUpdateStatementSettingsLoanUpdateTradingAccount

Permissions

Required permission
loans:update

Requires the `update` action on `loans` for the supplied runtime context

Path parameters

loanIdstring
required

Request body

This body is a typed union. Pick a variant to see its fields and a matching example.

Discriminated by type
type = "LoanUpdateAccountName"
accountNamestringrequired

Example Ada Lovelace

curl -X PATCH https://api.tst.au.apgpay.dev/loans/{loanId} \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "LoanUpdateAccountName",
  "accountName": "Ada Lovelace"
}'

Responses

The response is a tagged shape: type is always "LoanUpdateRspAttributes". Switch on it; subtypes can be added, and a client that already reads it will not break.

Discriminated by type
type = "LoanUpdateRspAttributes"

The loan as it stands after the change.

Present only where this patch replaced or cleared the statement settings: what they are now.

Example
{
  "type": "LoanUpdateRspAttributes",
  "updated": {
    "type": "LoanViewAttributes",
    "loanId": "loan_9f2Kd8QpLzXw",
    "merchantId": "mcht_9f2Kd8QpLzXw",
    "marketplaceId": "mktp_9f2Kd8QpLzXw",
    "customerId": "cust_9f2Kd8QpLzXw",
    "loanFacilityId": "lfac_9f2Kd8QpLzXw",
    "loanProductId": "lprod_9f2Kd8QpLzXw",
    "loanAgreementId": "lma_9f2Kd8QpLzXw",
    "accountName": "Ada Lovelace",
    "status": "Enabled",
    "balances": {
      "type": "LoanBalancesAttributes",
      "currency": "AUD",
      "limit": 500000,
      "used": 1250,
      "available": 1250,
      "reserved": 1250,
      "pending": 1250
    },
    "specification": {
      "type": "LoanSpecRealtimeSettlement",
      "variableFee": 12.5,
      "setting": "Manual"
    },
    "timeZone": "string",
    "billingPaymentSourceId": "psrc_9f2Kd8QpLzXw",
    "productLine": "CentralPay",
    "metadata": {
      "yourKey": {}
    },
    "referenceLoanId": "your-own-reference",
    "createdAt": "2026-08-19T04:21:07Z",
    "updatedAt": "2026-08-19T04:21:07Z"
  },
  "statementSettings": {
    "type": "LoanStatementSettingsConfigured",
    "documents": [
      {
        "type": "LoanStatementDocumentSettingViewAttributes",
        "format": "Csv",
        "enabled": true,
        "schemaVersion": "string",
        "channels": [
          "Email"
        ]
      }
    ],
    "statementEmails": [
      "ada@example.com"
    ],
    "readyNoticeEmails": [
      "ada@example.com"
    ],
    "transferEncryption": {
      "type": "LoanStatementTransferEncryptionViewAttributes",
      "method": "Zip",
      "secretSet": true
    },
    "systemIntegrations": [
      {
        "type": "LoanStatementSystemIntegrationAttributes",
        "sysCode": "string",
        "formats": [
          "Csv"
        ],
        "enabled": true,
        "referenceCustomerId": "your-own-reference",
        "isTest": true
      }
    ],
    "createdAt": "2026-08-19T04:21:07Z",
    "updatedAt": "2026-08-19T04:21:07Z"
  }
}

Error responses