APG PayAPG Paydocs

Loans

Create loan facilities

POST/loan-facilities

Create a loan facility.

Permissions

Required permission
loanFacilities:create

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

Request body

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

Discriminated by type
type = "LfacCmdCreate"
enterpriseIdEntIdrequired

Identifier of an enterprise.

Example ent_9f2Kd8QpLzXw

businessNamestringrequired

The name of the business lending through this facility.

Example Ada Lovelace

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

timeZonestringrequired

IANA time zone loans from this facility measure their statement periods in, Australia/Sydney.

referenceLoanFacilityIdstring

Example your-own-reference

organisationIdOrgId

An organisation already in the platform that this facility lends to, such as one of the enterprise's merchants. It must be one you can read on /organisations. The facility shares that organisation's record instead of one being made from businessName.

Example org_9f2Kd8QpLzXw

curl -X POST https://api.tst.au.apgpay.dev/loan-facilities \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "LfacCmdCreate",
  "enterpriseId": "ent_9f2Kd8QpLzXw",
  "businessName": "Ada Lovelace",
  "description": "string",
  "currency": "AUD",
  "timeZone": "string",
  "referenceLoanFacilityId": "your-own-reference",
  "organisationId": "org_9f2Kd8QpLzXw"
}'

Responses

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

Discriminated by type
type = "LfacCreateRspAttributes"

The resource that was created.

Example
{
  "type": "LfacCreateRspAttributes",
  "created": {
    "type": "LfacViewAttributes",
    "loanFacilityId": "lfac_9f2Kd8QpLzXw",
    "enterpriseId": "ent_9f2Kd8QpLzXw",
    "description": "string",
    "status": "Active",
    "balances": {
      "type": "LfacBalancesAttributes",
      "currency": "AUD",
      "available": 1250,
      "used": 1250,
      "reserved": 1250
    },
    "timeZone": "string",
    "businessProfile": {
      "type": "LfacBusinessProfileAttributes",
      "legalName": "Ada Lovelace",
      "businessNumber": "string",
      "taxRegistrationNumber": "string",
      "taxCountry": "AU",
      "tradingCountry": "AU",
      "contactEmail": "ada@example.com",
      "contactPhone": "+61400000000",
      "website": "string"
    },
    "statementReceivingAccounts": [
      {
        "type": "LfacReceivingAccountRuleAttributes",
        "productLines": [
          "CentralPay"
        ],
        "paymentMethods": [
          "DirectDebit"
        ],
        "account": {
          "type": "LfacBankAccountAttributes",
          "bsbNumber": "string",
          "accountNumber": "string",
          "bankName": "Ada Lovelace",
          "branch": "string",
          "swiftCode": "string"
        }
      }
    ],
    "branding": {
      "type": "LfacBrandingAttributes",
      "logoUri": "https://example.com/callback"
    },
    "referenceLoanFacilityId": "your-own-reference",
    "createdAt": "2026-08-19T04:21:07Z",
    "updatedAt": "2026-08-19T04:21:07Z"
  }
}

Error responses