Create loan statements
/loan-statementsCut a statement for a loan's current period, or recreate historic ones. Selected by the body's type.
LstmtCmdCreateLstmtCmdCreateHistoricPermissions
loanStatements:createRequires the `create` action on `loanStatements` for the supplied runtime context
Request body
This body is a typed union. Pick a variant to see its fields and a matching example.
typetype = "LstmtCmdCreate"loanIdLoanIdrequiredIdentifier of a loan.
Example loan_9f2Kd8QpLzXw
curl -X POST https://api.tst.au.apgpay.dev/loan-statements \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "LstmtCmdCreate",
"loanId": "loan_9f2Kd8QpLzXw"
}'Responses
The response is a tagged shape: type is always "LstmtCreateRspAttributes". Switch on it; subtypes can be added, and a client that already reads it will not break.
typetype = "LstmtCreateRspAttributes"The resource that was created.
typeenumrequiredLstmtViewAttributesloanStatementIdLstmtIdrequiredIdentifier of a loan statement.
Example lstmt_9f2Kd8QpLzXw
loanIdLoanIdrequiredIdentifier of a loan.
Example loan_9f2Kd8QpLzXw
referenceStatementIdstringrequiredThe platform's own reference for this statement, which is what appears on a remittance.
Example your-own-reference
merchantIdMchtIdrequiredThe merchant the borrower trades with.
Example mcht_9f2Kd8QpLzXw
customerIdCustIdThe borrowing customer, on a trading-account loan.
Example cust_9f2Kd8QpLzXw
statusLstmtStatusrequiredDraftOutstandingDueOverduePaidDefaultedCancelledUnknownperiodStartstring (date)requiredFirst day of the period this statement covers.
Example 2026-08-19
periodEndstring (date)requiredLast day of the period this statement covers.
Example 2026-08-19
billingDatestring (date)requiredThe day the statement was cut.
Example 2026-08-19
dueDatestring (date)requiredThe day payment falls due.
Example 2026-08-19
The cycle this statement was cut on.
typeA statement each day. Carries no issue day, because every day is one.
A statement each day. Carries no issue day, because every day is one.
A statement every second week, issued on this day of the week.
issueDayOfWeekLprodDayOfWeekrequiredMondayTuesdayWednesdayThursdayFridayUnknownA statement each month, issued on this day of the month.
issueDayOfMonthinteger (int32)requiredExample 6
A statement each week, issued on this day of the week.
issueDayOfWeekLprodDayOfWeekrequiredMondayTuesdayWednesdayThursdayFridayUnknownThe amounts on a loan statement. All are in the single currency given here.
typeenumrequiredLstmtAmountsAttributescurrencyIsoCurrencyrequiredAFNDZDARSAMDAWGAUDAZNBSDBHDTHB+156 moreShow fewer
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
netMinorUnitsrequiredEverything but insurance, before tax.
Example 1250
insuranceMinorUnitsrequiredInsurance entries, before tax.
Example 1250
taxMinorUnitsrequiredTax over every entry.
Example 1250
billedMinorUnitsrequiredTotal due on the statement, excluding late fees.
Example 1250
feesMinorUnitsFees on the statement, including tax on them.
Example 1250
paidMinorUnitsPaid towards the statement so far.
Example 1250
outstandingMinorUnitsrequiredStill to be paid, including late fees. Negative means the statement is in credit.
Example 1250
creditedMinorUnitsWhere a statement ended in credit, how much of that credit has gone to other statements.
Example 1250
typeenumrequiredLstmtEntryAttributesentryTypeLtxnEntryTyperequiredWhat kind of line this is.
ChargeRefundDisputeDisputeFeeInsuranceAnnualFeeImplementationFeePremiumAccountFeeExtendedPaymentTermsFeeCustomerTransactionFee+5 moreShow fewer
LatePaymentFee, BankFee, ThirdPartyServiceFee, ManualAdjustment, Unknown
descriptionstringrequiredA statement line's total and the tax within it. Both are in the single currency given here.
typeenumrequiredLstmtEntryAmountsAttributescurrencyIsoCurrencyrequiredAFNDZDARSAMDAWGAUDAZNBSDBHDTHB+156 moreShow fewer
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
totalMinorUnitsrequiredThe line's total, tax included.
Example 1250
taxMinorUnitsrequiredThe tax within the total.
Example 1250
netMinorUnitsrequiredThe total before tax. total − tax.
Example 1250
taxRatenumberThe rate the tax was charged at, as a decimal, 0.1 is 10%.
Example 0.9412
taxTypestringWhat the tax is called, GST.
The amount before currency conversion, where the movement was converted. Genuinely in another currency, so it carries its own.
typeenumrequiredIsoCurrencyAmountminorCurrencyUnitsinteger (int64)requiredThe amount in minor currency units (e.g. cents for AUD).
Example 1250
currencyIsoCurrencyrequiredThe currency of the given amount as a 3 letter ISO code.
AFNDZDARSAMDAWGAUDAZNBSDBHDTHB+156 moreShow fewer
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
loanTransactionIdLtxnIdThe movement this line came from, where a line has one. Generated fees do not.
Example ltxn_9f2Kd8QpLzXw
entryAtstring (date-time)requiredWhen the movement this line records happened.
Example 2026-08-19T04:21:07Z
The late-payment fee charged on this statement, where one has been.
typeenumrequiredLstmtLateFeeAttributesA statement line's total and the tax within it. Both are in the single currency given here.
typeenumrequiredLstmtEntryAmountsAttributescurrencyIsoCurrencyrequiredAFNDZDARSAMDAWGAUDAZNBSDBHDTHB+156 moreShow fewer
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
totalMinorUnitsrequiredThe line's total, tax included.
Example 1250
taxMinorUnitsrequiredThe tax within the total.
Example 1250
netMinorUnitsrequiredThe total before tax. total − tax.
Example 1250
calculatedTostring (date)The date the fee has been calculated up to. It grows until the statement is paid.
Example 2026-08-19
narrativestringAn internal note on how the fee was worked out.
linkedStatementIdLstmtIdFor a statement that exists because of another, a late-fee invoice, the statement it relates to.
Example lstmt_9f2Kd8QpLzXw
narrativestringAn internal note about this statement.
createdAtstring (date-time)requiredExample 2026-08-19T04:21:07Z
updatedAtstring (date-time)requiredExample 2026-08-19T04:21:07Z
{
"type": "LstmtCreateRspAttributes",
"created": {
"type": "LstmtViewAttributes",
"loanStatementId": "lstmt_9f2Kd8QpLzXw",
"loanId": "loan_9f2Kd8QpLzXw",
"referenceStatementId": "your-own-reference",
"merchantId": "mcht_9f2Kd8QpLzXw",
"customerId": "cust_9f2Kd8QpLzXw",
"status": "Draft",
"periodStart": "2026-08-19",
"periodEnd": "2026-08-19",
"billingDate": "2026-08-19",
"dueDate": "2026-08-19",
"statementFrequency": {
"type": "LprodFrequencyDaily"
},
"amounts": {
"type": "LstmtAmountsAttributes",
"currency": "AUD",
"net": 1250,
"insurance": 1250,
"tax": 1250,
"billed": 1250,
"fees": 1250,
"paid": 1250,
"outstanding": 1250,
"credited": 1250
},
"entries": [
{
"type": "LstmtEntryAttributes",
"entryType": "Charge",
"description": "string",
"amounts": {
"type": "LstmtEntryAmountsAttributes",
"currency": "AUD",
"total": 1250,
"tax": 1250,
"net": 1250
},
"taxRate": 0.9412,
"taxType": "string",
"originalAmount": {
"type": "IsoCurrencyAmount",
"minorCurrencyUnits": 1250,
"currency": "AUD"
},
"loanTransactionId": "ltxn_9f2Kd8QpLzXw",
"entryAt": "2026-08-19T04:21:07Z"
}
],
"lateFee": {
"type": "LstmtLateFeeAttributes",
"amounts": {
"type": "LstmtEntryAmountsAttributes",
"currency": "AUD",
"total": 1250,
"tax": 1250,
"net": 1250
},
"calculatedTo": "2026-08-19",
"narrative": "string"
},
"linkedStatementId": "lstmt_9f2Kd8QpLzXw",
"narrative": "string",
"createdAt": "2026-08-19T04:21:07Z",
"updatedAt": "2026-08-19T04:21:07Z"
}
}Error responses
statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}