curl --request GET \
--url https://api.skia.money/v1/invoices/{invoiceId}/receivable \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.skia.money/v1/invoices/{invoiceId}/receivable"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.skia.money/v1/invoices/{invoiceId}/receivable', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.skia.money/v1/invoices/{invoiceId}/receivable",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.skia.money/v1/invoices/{invoiceId}/receivable"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.skia.money/v1/invoices/{invoiceId}/receivable")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.skia.money/v1/invoices/{invoiceId}/receivable")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"invoiceId": "<string>",
"claimHash": "<string>",
"issuer": "<string>",
"debtor": "<string>",
"currency": "<string>",
"settleChainId": 123,
"faceAmount": "<string>",
"status": "ISSUED",
"outstanding": "<string>",
"paidToDate": "<string>",
"creditedToDate": "<string>",
"openDisputedAmount": "<string>",
"overdue": true,
"lateFeeAccrued": "<string>",
"dueAt": 123,
"gracePeriodSeconds": 123,
"lateFeeBpsPerDay": 123,
"surplus": "<string>",
"events": [
{
"eventId": "<string>",
"invoiceId": "<string>",
"seq": 123,
"type": "ISSUE",
"actor": "<string>",
"role": "ISSUER",
"claimHash": "<string>",
"recordedAt": 123,
"signature": "<string>",
"payload": {},
"derived": true,
"sourceEventId": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}Single receivable view (pure fold — status never stored)
SERVED (round-13). The fold view of ONE invoice (Receivable). STATUS IS NEVER STORED — it is a PURE FOLD over the append-only event list (property-tested: no unreachable states; overdue/partial always derivable). Money arithmetic is INTEGER atomic-unit math — floats never touch money on this surface. The late fee is a NON-COMPOUNDING read-time accrual on outstanding − disputed (see Receivable for the locked formula; round-13 (H): the clock FREEZES at the DEFAULT event’s recordedAt once the invoice is DEFAULTED). Auth: bearer must be the issuer or the debtor (403 otherwise). The events list is included — the audit trail is first-class.
curl --request GET \
--url https://api.skia.money/v1/invoices/{invoiceId}/receivable \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.skia.money/v1/invoices/{invoiceId}/receivable"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.skia.money/v1/invoices/{invoiceId}/receivable', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.skia.money/v1/invoices/{invoiceId}/receivable",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.skia.money/v1/invoices/{invoiceId}/receivable"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.skia.money/v1/invoices/{invoiceId}/receivable")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.skia.money/v1/invoices/{invoiceId}/receivable")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"invoiceId": "<string>",
"claimHash": "<string>",
"issuer": "<string>",
"debtor": "<string>",
"currency": "<string>",
"settleChainId": 123,
"faceAmount": "<string>",
"status": "ISSUED",
"outstanding": "<string>",
"paidToDate": "<string>",
"creditedToDate": "<string>",
"openDisputedAmount": "<string>",
"overdue": true,
"lateFeeAccrued": "<string>",
"dueAt": 123,
"gracePeriodSeconds": 123,
"lateFeeBpsPerDay": 123,
"surplus": "<string>",
"events": [
{
"eventId": "<string>",
"invoiceId": "<string>",
"seq": 123,
"type": "ISSUE",
"actor": "<string>",
"role": "ISSUER",
"claimHash": "<string>",
"recordedAt": 123,
"signature": "<string>",
"payload": {},
"derived": true,
"sourceEventId": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}Authorizations
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.
Response
The fold view (recomputed at read time)
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.
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).
ISSUED, ACKNOWLEDGED, PARTIALLY_PAID, SETTLED, REJECTED, VOIDED, DEFAULTED