APG PayAPG Paydocs

Loans

Create loans

POST/loans

Apply for a loan, or accept an offer. Selected by the body's type. Applying answers with an offer; accepting it answers with the loan.

2 actionsLoanCmdAcceptOfferLoanCmdApply

Permissions

Required permission

Required action depends on the request variant. Select a variant in the request body below to see the permission it requires.

Request body

This body is a typed union. Pick a variant to see its fields, the permission it requires, and a matching example.

Discriminated by type
type = "LoanCmdAcceptOffer"
Required permission
loans:activate

Accept a loan offer

The offer being accepted, the one LoanCmdApply answered with, unchanged.

acceptTermsAndConditionsbooleanrequired

Confirmation that the borrower has agreed to the offer's terms and conditions. Must be true.

Example true

curl -X POST https://api.tst.au.apgpay.dev/loans \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "LoanCmdAcceptOffer",
  "offer": {
    "type": "LoanOfferAttributes",
    "loanProductId": "lprod_9f2Kd8QpLzXw",
    "loanAgreementId": "lma_9f2Kd8QpLzXw",
    "merchantId": "mcht_9f2Kd8QpLzXw",
    "timeZone": "string",
    "termsAndConditions": "string",
    "expiresAt": "2026-08-19T04:21:07Z",
    "offerToken": "tok_9f2Kd8QpLzXwR4mN",
    "specification": {
      "type": "LoanOfferSpecRealtimeSettlement",
      "maxLimit": {
        "type": "IsoCurrencyAmount",
        "minorCurrencyUnits": 1250,
        "currency": "AUD"
      },
      "variableFee": 12.5
    },
    "metadata": {
      "yourKey": {}
    },
    "referenceLoanId": "your-own-reference"
  },
  "acceptTermsAndConditions": true
}'

Responses

The response is a typed union.

Discriminated by type
type = "LoanCreateRspOffered"

An offer of a loan on stated terms. Hand it back to LoanCmdAcceptOffer to open the loan.

Example
{
  "type": "LoanCreateRspOffered",
  "offer": {
    "type": "LoanOfferAttributes",
    "loanProductId": "lprod_9f2Kd8QpLzXw",
    "loanAgreementId": "lma_9f2Kd8QpLzXw",
    "merchantId": "mcht_9f2Kd8QpLzXw",
    "timeZone": "string",
    "termsAndConditions": "string",
    "expiresAt": "2026-08-19T04:21:07Z",
    "offerToken": "tok_9f2Kd8QpLzXwR4mN",
    "specification": {
      "type": "LoanOfferSpecRealtimeSettlement",
      "maxLimit": {
        "type": "IsoCurrencyAmount",
        "minorCurrencyUnits": 1250,
        "currency": "AUD"
      },
      "variableFee": 12.5
    },
    "metadata": {
      "yourKey": {}
    },
    "referenceLoanId": "your-own-reference"
  }
}

Error responses