APG PayAPG Paydocs

Loans

Create loan agreements

POST/loan-agreements

Create a loan agreement against a facility.

Permissions

Required permission
loanMasterAgreements:create

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

Request body

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

Discriminated by type
type = "LmaCmdCreate"
loanFacilityIdLfacIdrequired

Identifier of a loan facility.

Example lfac_9f2Kd8QpLzXw

referenceAgreementIdstringrequired

Example your-own-reference

descriptionstringrequired
currencyIsoCurrencyrequired
AFNDZDARSAMDAWGAUDAZNBSDBHDTHB
+156 more

PAB, BBD, BYR, BZD, BMD, VEF, BOB, BRL, BND, BGN, BIF, CAD, CVE, KYD, XOF, XAF, XPF, CLP, COP, KMF, CDF, BAM, NIO, CRC, HRK, CUP, CZK, GMD, DKK, MKD, DJF, STD, DOP, VND, XCD, EGP, SVC, ETB, EUR, FKP, FJD, HUF, GHS, GIP, HTG, PYG, GNF, GYD, HKD, UAH, ISK, INR, IRR, IQD, JMD, JOD, KES, PGK, LAK, KWD, MWK, AOA, MMK, GEL, LBP, ALL, HNL, SLL, LRD, LYD, SZL, LSL, MGA, MYR, MUR, MXN, MXV, MDL, MAD, MZN, BOV, NGN, ERN, NAD, NPR, ANG, ILS, TWD, NZD, BTN, KPW, NOK, PEN, MRU, PKR, MOP, TOP, CUC, UYU, PHP, GBP, BWP, QAR, GTQ, ZAR, OMR, KHR, RON, MVR, IDR, RUB, RWF, SHP, SAR, RSD, SCR, SGD, SBD, KGS, SOS, TJS, SSP, LKR, SDG, SRD, SEK, CHF, SYP, BDT, WST, TZS, KZT, TTD, MNT, TND, TRY, TMT, AED, UGX, COU, CLF, UYI, USD, USN, USS, UZS, VUV, CHE, CHW, KRW, YER, JPY, CNY, ZMW, ZWL, PLN

curl -X POST https://api.tst.au.apgpay.dev/loan-agreements \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "LmaCmdCreate",
  "loanFacilityId": "lfac_9f2Kd8QpLzXw",
  "referenceAgreementId": "your-own-reference",
  "description": "string",
  "currency": "AUD"
}'

Responses

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

Discriminated by type
type = "LmaCreateRspAttributes"

The resource that was created.

Example
{
  "type": "LmaCreateRspAttributes",
  "created": {
    "type": "LmaViewAttributes",
    "loanAgreementId": "lma_9f2Kd8QpLzXw",
    "loanFacilityId": "lfac_9f2Kd8QpLzXw",
    "enterpriseId": "ent_9f2Kd8QpLzXw",
    "referenceAgreementId": "your-own-reference",
    "description": "string",
    "balances": {
      "type": "LmaBalancesAttributes",
      "currency": "AUD",
      "available": 1250,
      "used": 1250,
      "maxLimit": 500000
    },
    "createdAt": "2026-08-19T04:21:07Z",
    "updatedAt": "2026-08-19T04:21:07Z"
  }
}

Error responses