Skip to main content
POST
Acknowledge or reject an invoice (debtor countersignature over the SAME claim digest)

Authorizations

Authorization
string
header
required

TESTNET posture: simulated signature bearer — the token is the caller's 0x (address-as-identity; no per-request signature verification). Real EIP-191/EIP-712-verified bearers + SIWE (EIP-4361) sessions for the hosted UI arrive in v1.7.0. The settlement security boundary is the EIP-712 Order signature verified by SwapERC20 on-chain, not this credential. See docs/auth-posture-testnet.md.

Path Parameters

invoiceId
string
required

Body

application/json
decision
enum<string>
required

The decision word is ledger-recorded and NOT covered by the countersignature — the disclosed Phase-1 ledger-trust boundary (Phase 2 binds decisions into signed structs alongside the transcript protocol).

Available options:
acknowledge,
reject
debtorSignature
string
required

65-byte countersignature over the SAME claim digest; MUST recover to claim.debtor and verify against the issued claimHash.

Response

Decision recorded (ACK or REJECT event appended)

THE FOLD VIEW — computed at read time; nothing here is stored except the event list it derives from. FOLD PRECEDENCE — LOCKED BEFORE CODE (R-3, the Gemini condition): payments reduce PRINCIPAL ONLY; credit notes reduce PRINCIPAL ONLY (credited exactly once — the dispute closure a note triggers is a FLAG transition, never a second deduction); the late fee is a NON-COMPOUNDING read-time accrual on outstanding − disputed: lateFeeAccrued = floor(undisputedOutstanding × lateFeeBpsPerDay × wholeDaysPastDue / 10000), where wholeDaysPastDue counts whole 86400-second days from dueAt + gracePeriodSeconds (unix seconds, never block numbers). FEES NEVER CONSUME PAYMENTS in Phase 1 — the late fee is a computed number for reporting and policy, NOT a balance: it never increases outstanding and never reduces a payment. Disputed amount: the latest open DISPUTE's disputedAmount (SUPERSEDES, never sums); a derived RESOLVE zeroes it. Overage (paid + credited > face) is surfaced as surplus and settled OUT-OF-BAND in Phase 1 (disclosed). LATE-FEE CLOCK AT DEFAULT (round-13 (H), G-3): the accrual clock freezes at the DEFAULT event's recordedAt — lateFeeAccrued counts whole days only up to min(now, T_default) once the invoice is DEFAULTED; the base stays the live undisputed remainder (a post-DEFAULT payment shrinks the fee, never grows the clock). Integer atomic-unit arithmetic ONLY.

invoiceId
string
required
claimHash
string
required
issuer
string
required
debtor
string
required
currency
string
required
settleChainId
integer
required
faceAmount
string<uint256>
required
status
enum<string>
required

DERIVED FOLD STATE — NEVER STORED (property-tested: no unreachable states; overdue/partial always derivable from the event list). Fold skeleton: ISSUE -> ISSUED; +ACK -> ACKNOWLEDGED; +first RECEIPTED payment while outstanding > 0 -> PARTIALLY_PAID; outstanding == 0 -> SETTLED (terminal); +REJECT -> REJECTED (terminal); +VOID -> VOIDED (terminal) — VOID GUARD (round-13 (G), G-2): REFUSED once paidToDate > 0 (409 INVOICE_STATE_INVALID) — a VOID after money moved strands debtor funds on the out-of-band refund path; VOID stays a clean-withdrawal instrument for UNPAID claims and moneyed claims unwind with credit notes (creditedToDate does NOT trip the guard); +DEFAULT (issuer-signed, ONLY after dueAt + gracePeriodSeconds, ONLY from a non-terminal state with outstanding > 0) -> DEFAULTED (terminal). DEFAULT is an ASSERTED issuer-declared reputation signal after grace — NOT cryptographic proof of non-payment (the debtor may have paid on a rail outside the issuer's view; R-5 — decentralized default attestation is Phase 3). LATE-FEE CLOCK (round-13 (H), G-3): the accrual clock FREEZES at the DEFAULT event's recordedAt once the invoice is DEFAULTED — terminals are absorbing, the fee clock stops with the status (the base stays the live undisputed remainder). OVERDUE and OPEN-DISPUTE are orthogonal FLAGS on the Receivable view, not states. Payments received on a VOIDED/REJECTED claim are recorded as events; refunds are OUT-OF-BAND in Phase 1 (disclosed — no on-chain refund rail exists for them).

Available options:
ISSUED,
ACKNOWLEDGED,
PARTIALLY_PAID,
SETTLED,
REJECTED,
VOIDED,
DEFAULTED
outstanding
string<uint256>
required

max(0, face − paidToDate − creditedToDate).

paidToDate
string<uint256>
required

Σ RECEIPTED PAYMENT amounts (invoice-currency atomic units).

creditedToDate
string<uint256>
required

Σ CREDIT_NOTE amounts.

openDisputedAmount
string<uint256>
required

The latest open DISPUTE's amount; 0 when none or resolved.

overdue
boolean
required

now > dueAt + gracePeriodSeconds AND outstanding > 0 AND status not terminal.

lateFeeAccrued
string<uint256>
required

Read-time derived (the locked formula); 0 before accrual start. NEVER a balance.

dueAt
integer
required
gracePeriodSeconds
integer
required
lateFeeBpsPerDay
integer
required
surplus
string<uint256>

max(0, paidToDate + creditedToDate − faceAmount) — out-of-band refund in Phase 1 (disclosed).

events
object[]