Credit Note Balance

Audit a credit note against open invoice balances, applying valid allocations in order and reporting overallocations and unknown invoices.

Custom requests cost 0.04 USDC on Base.

Download example JSON · OpenAPI · Source and usage

Pay with a browser wallet · Open example in checkout

POST a JSON request to /credit-note-balance/v1/check with an x402 V2 client.

Worked example

Request

{
  "credit_cents": 1000,
  "invoices": [
    {
      "id": "A",
      "open_cents": 500
    },
    {
      "id": "B",
      "open_cents": 1200
    }
  ],
  "allocations": [
    {
      "invoice_id": "A",
      "cents": 500
    },
    {
      "invoice_id": "A",
      "cents": 20
    },
    {
      "invoice_id": "B",
      "cents": 600
    },
    {
      "invoice_id": "B",
      "cents": 400
    }
  ]
}

Result

{
  "remaining_credit_cents": 100,
  "accepted_cents": 900,
  "invoices": [
    {
      "id": "A",
      "open_cents": 0
    },
    {
      "id": "B",
      "open_cents": 800
    }
  ],
  "rejected": [
    {
      "index": 1,
      "reason": "invoice_balance"
    },
    {
      "index": 2,
      "reason": "credit_balance"
    }
  ]
}

Support catalog maintenance through GitHub Sponsors. Sponsor gptenv · Sponsor Jeremy Carter