APG PayAPG Paydocs

Settlement

Update merchant invoice

PATCH/merchant-invoices/{merchantInvoiceId}

Record an out-of-band payment, resend the invoice by email, or push it through a billing run. Selected by the body's type.

3 actionsMinvUpdateMarkPaidMinvUpdateProcessMinvUpdateResendEmail

Permissions

Required permission

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

Path parameters

merchantInvoiceIdstring
required

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 = "MinvUpdateMarkPaid"
Required permission
merchantFinancials:update

Record an out-of-band payment

amountCreditedMinorUnits

How much to credit, in minor units of the invoice's currency. Omit to credit the whole outstanding amount. A part payment leaves the invoice unpaid.

Example 1250

curl -X PATCH https://api.tst.au.apgpay.dev/merchant-invoices/{merchantInvoiceId} \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "MinvUpdateMarkPaid",
  "amountCredited": 1250
}'

Responses

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

Discriminated by type
type = "MinvUpdateRspAttributes"

The resource as it stands after the change.

Example
{
  "type": "MinvUpdateRspAttributes",
  "updated": {
    "type": "MinvViewAttributes",
    "merchantInvoiceId": "minv_9f2Kd8QpLzXw",
    "reference": "your-own-reference",
    "payerMerchantId": "mcht_9f2Kd8QpLzXw",
    "payerName": "Ada Lovelace",
    "payeeMerchantId": "mcht_9f2Kd8QpLzXw",
    "payerMarketplaceId": "mktp_9f2Kd8QpLzXw",
    "payerEnterpriseId": "ent_9f2Kd8QpLzXw",
    "status": "Draft",
    "amounts": {
      "type": "MinvAmountsAttributes",
      "currency": "AUD",
      "invoiced": 1250,
      "paid": 1250,
      "outstanding": 1250
    },
    "periodStart": "2026-08-19",
    "periodEnd": "2026-08-19",
    "dueDate": "2026-08-19",
    "issuedOn": "2026-08-19",
    "narrative": "string",
    "orderId": "ordr_9f2Kd8QpLzXw",
    "ledgerClearance": {
      "type": "MinvLedgerClearanceAttributes",
      "systemLedgerId": "string",
      "firstSequence": 1250,
      "lastSequence": 1250
    },
    "payments": [
      {
        "type": "MinvPaymentAbandoned",
        "at": "2026-08-19T04:21:07Z",
        "summary": "string"
      }
    ],
    "items": [
      {
        "type": "MinvItemAttributes",
        "itemType": "PayInFullFee",
        "category": "string",
        "categoryLabel": "string",
        "unitPrice": "string",
        "count": 42,
        "transactionValue": 1250,
        "fees": 1250,
        "tax": 1250
      }
    ],
    "billing": {
      "type": "MinvBillingAttributes",
      "businessName": "Ada Lovelace",
      "taxId": "string",
      "emailAddress": "ada@example.com",
      "phoneNumber": "+61400000000",
      "address": {
        "type": "PsonAddressAttributes",
        "unitNumber": "string",
        "streetNumber": "string",
        "streetName": "Ada Lovelace",
        "streetType": "string",
        "suburb": "string",
        "city": "string",
        "state": "string",
        "postalCode": "3000",
        "country": "AU"
      }
    },
    "manualPayment": {
      "type": "MinvManualPaymentAttributes",
      "token": "tok_9f2Kd8QpLzXwR4mN",
      "paymentUrl": "https://example.com/callback",
      "orderId": "ordr_9f2Kd8QpLzXw"
    },
    "createdAt": "2026-08-19T04:21:07Z",
    "updatedAt": "2026-08-19T04:21:07Z"
  }
}

Error responses