@siglume/direct-request-payment 0.4.2 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,9 +16,10 @@ order challenge; the buyer-facing Siglume payment flow pays it.
16
16
 
17
17
  This quickstart is for SDRP Standard Payment in an external merchant product.
18
18
  Micro Payment and Nano Payment are applied automatically by amount and settled on
19
- a weekly / monthly cadence (see [Pricing](./pricing.md#settlement-schedule)); they
20
- are not browser checkout requirements you create with this SDK. Their provider
21
- revenue remains unsettled until the later on-chain settlement succeeds.
19
+ account-assigned weekly / monthly slots after the final notice and close-plus-3-day
20
+ site (see [Pricing](./pricing.md#settlement-schedule)); they are not browser
21
+ checkout requirements you create with this SDK. Their provider revenue remains
22
+ unsettled until the later on-chain settlement succeeds.
22
23
 
23
24
  ## Two Buyer Systems
24
25
 
@@ -430,6 +431,58 @@ if verified["event"]["type"] == "direct_payment.confirmed":
430
431
  )
431
432
  ```
432
433
 
434
+ ## Reconcile Micro / Nano Statements
435
+
436
+ Standard Payment can be fulfilled from the verified
437
+ `direct_payment.confirmed` webhook. Micro Payment and Nano Payment are different:
438
+ they are automatic amount bands and are settled later in aggregated on-chain
439
+ batches. Use the statement APIs to answer:
440
+
441
+ - how much Micro / Nano usage is open this week or month,
442
+ - when the buyer's assigned period closes,
443
+ - when Siglume may first attempt the debit (`not_before_attempt_at`),
444
+ - how much provider revenue is settled, unsettled, retrying, or past due.
445
+
446
+ Provider summary:
447
+
448
+ ```ts
449
+ import { DirectRequestPaymentClient } from "@siglume/direct-request-payment";
450
+
451
+ const siglume = new DirectRequestPaymentClient({
452
+ auth_token: providerSiglumeBearerToken,
453
+ });
454
+
455
+ const summary = await siglume.request<{
456
+ open_periods: Array<Record<string, unknown>>;
457
+ periods: Array<Record<string, unknown>>;
458
+ totals: Record<string, string>;
459
+ }>(
460
+ "GET",
461
+ "/sdrp/metered/provider/summary?plan_type=micro&token_symbol=JPYC",
462
+ );
463
+
464
+ console.log(summary.totals.settled_provider_receivable_minor);
465
+ console.log(summary.totals.unsettled_provider_receivable_minor);
466
+ console.log(summary.totals.past_due_provider_receivable_minor);
467
+ ```
468
+
469
+ Line-level CSV export:
470
+
471
+ ```bash
472
+ curl https://siglume.com/v1/sdrp/metered/provider/settlement-batches/<batch-id>/usage-events.csv \
473
+ -H "Authorization: Bearer <provider-siglume-bearer-token>" \
474
+ -o sdrp-metered.csv
475
+ ```
476
+
477
+ Python does not expose a public generic request helper in this release. Use
478
+ ordinary HTTPS requests with the provider's Siglume bearer token for these
479
+ statement endpoints.
480
+
481
+ Do not book Micro / Nano provider revenue as settled revenue until the batch is
482
+ `settled` and `chain_receipt_id` is present. See
483
+ [Micro / Nano Statements and Notices](./metered-statements.md) for the full
484
+ manual, including buyer past-due blocks and public failure fields.
485
+
433
486
  ## Failure Handling
434
487
 
435
488
  - `EXTERNAL_402_CHALLENGE_REQUIRED`: the merchant server did not provide a
@@ -465,3 +518,6 @@ if verified["event"]["type"] == "direct_payment.confirmed":
465
518
  - Nonces cannot be reused for separate order attempts.
466
519
  - The order is fulfilled only after a verified webhook maps back to the stored
467
520
  `challenge_hash`.
521
+ - Micro / Nano accounting reads statement APIs or CSV and keeps settled,
522
+ unsettled, and past-due revenue separate.
523
+ - Micro / Nano provider revenue is not recognized before on-chain settlement.
@@ -0,0 +1,367 @@
1
+ # Micro / Nano Statements and Notices
2
+
3
+ This guide is the operating manual for SDRP Micro Payment and Nano Payment
4
+ after a payment is accepted.
5
+
6
+ Use it when you need to answer:
7
+
8
+ - how much Micro / Nano usage happened in the current period,
9
+ - when the period closes,
10
+ - when Siglume may first attempt the aggregated debit,
11
+ - how much provider revenue is settled, unsettled, retrying, or past due,
12
+ - what a buyer must fix before new Micro / Nano usage can resume.
13
+
14
+ Micro and Nano are automatic amount bands. You do not create a separate Micro or
15
+ Nano checkout request. The same payment or paid-capability flow runs, then
16
+ Siglume applies the settlement band from the amount.
17
+
18
+ ## Core Settlement Rules
19
+
20
+ | Band | Cadence | Period close | First debit attempt | Revenue recognition |
21
+ | --- | --- | --- | --- | --- |
22
+ | Micro Payment | Weekly | Account-assigned fixed weekly slot in the buyer settlement timezone | After final debit notice delivery and the fixed close-plus-3-day site | Only after the aggregated settlement confirms on-chain |
23
+ | Nano Payment | Monthly | Account-assigned fixed monthly slot in the buyer settlement timezone | After final debit notice delivery and the fixed close-plus-3-day site | Only after the aggregated settlement confirms on-chain |
24
+
25
+ The schedule is platform-managed. Buyers and providers can see the assigned
26
+ period and scheduled attempt times through the statement APIs, but cannot choose
27
+ a custom close day.
28
+
29
+ The important timestamp is `not_before_attempt_at`. Siglume does not execute the
30
+ debit before this timestamp. It is always after the final debit notice is
31
+ recorded and at least 72 hours after the period close.
32
+
33
+ Provider revenue is not settled revenue while a batch is open, scheduled,
34
+ failed, retrying, submitted, or past due. Treat `settled_at` and
35
+ `chain_receipt_id` on a `settled` batch as the durable on-chain settlement
36
+ signal.
37
+
38
+ ## Authentication Roles
39
+
40
+ Buyer endpoints use the buyer's Siglume bearer token. Use these only in a buyer
41
+ account page or buyer support view.
42
+
43
+ Provider endpoints use the provider / publisher / merchant user's Siglume bearer
44
+ token. Provider responses never include raw `buyer_user_id`, buyer email, or raw
45
+ wallet identifiers. Use `buyer_period_ref` to reconcile repeated usage by the
46
+ same buyer within the provider's statement period without receiving buyer PII.
47
+
48
+ TypeScript can call JSON statement endpoints with
49
+ `DirectRequestPaymentClient.request<T>()`. Python does not expose a public
50
+ generic request helper in this release; use ordinary HTTPS requests with the
51
+ same bearer token.
52
+
53
+ ## Buyer Statement APIs
54
+
55
+ ### Summary
56
+
57
+ TypeScript:
58
+
59
+ ```ts
60
+ import { DirectRequestPaymentClient } from "@siglume/direct-request-payment";
61
+
62
+ const siglume = new DirectRequestPaymentClient({
63
+ auth_token: buyerSiglumeBearerToken,
64
+ });
65
+
66
+ const summary = await siglume.request<{
67
+ role: "buyer";
68
+ open_periods: Array<Record<string, unknown>>;
69
+ settlement_batches: Array<Record<string, unknown>>;
70
+ past_due_blocks: Array<Record<string, unknown>>;
71
+ balance_sufficiency: Record<string, unknown>;
72
+ }>(
73
+ "GET",
74
+ "/sdrp/metered/my-summary?plan_type=micro&token_symbol=JPYC",
75
+ );
76
+ ```
77
+
78
+ Raw HTTP / Python:
79
+
80
+ ```bash
81
+ curl https://siglume.com/v1/sdrp/metered/my-summary?plan_type=micro\&token_symbol=JPYC \
82
+ -H "Authorization: Bearer <buyer-siglume-bearer-token>"
83
+ ```
84
+
85
+ Use `open_periods` to show current-period estimated debit. Use
86
+ `settlement_batches` for closed or already scheduled periods. Use
87
+ `past_due_blocks` to explain why new Micro / Nano usage is blocked.
88
+
89
+ `balance_sufficiency` is a cheap current-state indicator. When available, it
90
+ checks whether BudgetVault status and configured caps look sufficient for the
91
+ open period. It can report `wallet_balance_checked: false` or
92
+ `allowance_checked: false`; in that case it is guidance, not a final on-chain
93
+ guarantee.
94
+
95
+ ### Usage Events
96
+
97
+ ```text
98
+ GET /v1/sdrp/metered/my-usage-events
99
+ ```
100
+
101
+ Query parameters:
102
+
103
+ - `plan_type`: `micro` or `nano`
104
+ - `token_symbol`: `JPYC` or `USDC`
105
+ - `status`: for example `pending_settlement`, `settled`, `failed_chargeable`
106
+ - `limit`: 1 to 500
107
+
108
+ Buyer usage event amount fields:
109
+
110
+ - `provider_usage_amount_minor`: provider price for the usage event
111
+ - `protocol_fee_minor`: metered protocol fee
112
+ - `gross_buyer_debit_minor`: expected buyer debit for the event
113
+ - `expected_scheduled_debit_at`: derived schedule for an open period before a
114
+ settlement batch exists
115
+
116
+ ### Settlement Batches
117
+
118
+ ```text
119
+ GET /v1/sdrp/metered/my-settlement-batches
120
+ ```
121
+
122
+ Query parameters:
123
+
124
+ - `plan_type`: `micro` or `nano`
125
+ - `token_symbol`: `JPYC` or `USDC`
126
+ - `status`: `notice_pending`, `ready`, `submitted`, `settled`, `failed`,
127
+ `past_due`, or `notice_delivery_failed`
128
+ - `limit`: 1 to 200
129
+
130
+ Buyer batch amount fields:
131
+
132
+ - `estimated_buyer_debit_minor`: total buyer debit for the batch
133
+ - `provider_usage_amount_minor`: provider usage amount before protocol fee
134
+ - `gross_buyer_debit_minor`: provider usage amount plus protocol fee
135
+ - `buyer_debit_minor`: amount scheduled for the debit transaction
136
+
137
+ Past-due batches include:
138
+
139
+ - `past_due_block_reason`: `METERED_SETTLEMENT_PAST_DUE`
140
+ - `failure_reason_code`
141
+ - `failure_reason_label`
142
+ - `failure_reason_help`
143
+ - `support_reference`
144
+
145
+ Buyer-triggered requeue is not part of the MVP. The buyer-facing UI should show
146
+ the block reason, tell the buyer to repair balance / allowance / BudgetVault /
147
+ caps, and point them to support with `support_reference`.
148
+
149
+ ## Provider Statement APIs
150
+
151
+ ### Summary
152
+
153
+ TypeScript:
154
+
155
+ ```ts
156
+ const siglume = new DirectRequestPaymentClient({
157
+ auth_token: providerSiglumeBearerToken,
158
+ });
159
+
160
+ const providerSummary = await siglume.request<{
161
+ role: "provider";
162
+ timezone: string;
163
+ filters: Record<string, unknown>;
164
+ open_periods: Array<Record<string, unknown>>;
165
+ periods: Array<Record<string, unknown>>;
166
+ totals: Record<string, string>;
167
+ }>(
168
+ "GET",
169
+ "/sdrp/metered/provider/summary?plan_type=micro&token_symbol=JPYC",
170
+ );
171
+ ```
172
+
173
+ Raw HTTP / Python:
174
+
175
+ ```bash
176
+ curl https://siglume.com/v1/sdrp/metered/provider/summary?plan_type=micro\&token_symbol=JPYC \
177
+ -H "Authorization: Bearer <provider-siglume-bearer-token>"
178
+ ```
179
+
180
+ Query parameters:
181
+
182
+ - `plan_type`: `micro` or `nano`
183
+ - `token_symbol`: `JPYC` or `USDC`
184
+ - `listing_id`: restrict to one listing
185
+ - `capability_key`: restrict to one capability
186
+
187
+ Use:
188
+
189
+ - `open_periods` for current-period expected revenue before a batch exists,
190
+ - `periods` for closed, scheduled, retrying, past-due, submitted, or settled
191
+ batches,
192
+ - `totals.settled_provider_receivable_minor` for revenue already settled,
193
+ - `totals.unsettled_provider_receivable_minor` for expected but not yet settled
194
+ revenue,
195
+ - `totals.past_due_provider_receivable_minor` for provider revenue blocked on a
196
+ past-due buyer settlement.
197
+
198
+ ### Usage Events
199
+
200
+ ```text
201
+ GET /v1/sdrp/metered/provider/usage-events
202
+ ```
203
+
204
+ Query parameters:
205
+
206
+ - `plan_type`
207
+ - `token_symbol`
208
+ - `status`
209
+ - `listing_id`
210
+ - `capability_key`
211
+ - `limit`: 1 to 500
212
+
213
+ Provider usage event fields include:
214
+
215
+ - `provider_receivable_minor`
216
+ - `protocol_fee_minor`
217
+ - `gross_buyer_debit_minor`
218
+ - `period_start`
219
+ - `period_end`
220
+ - `expected_scheduled_debit_at`
221
+ - `settlement_batch_id`
222
+ - `buyer_period_ref`
223
+
224
+ `buyer_period_ref` is the only buyer correlation identifier exposed to
225
+ providers. Do not expect raw buyer account IDs in provider APIs.
226
+
227
+ ### Settlement Batches
228
+
229
+ ```text
230
+ GET /v1/sdrp/metered/provider/settlement-batches
231
+ GET /v1/sdrp/metered/provider/settlement-batches/{settlement_batch_id}
232
+ ```
233
+
234
+ Query parameters for the list endpoint:
235
+
236
+ - `plan_type`
237
+ - `token_symbol`
238
+ - `status`
239
+ - `listing_id`
240
+ - `capability_key`
241
+ - `limit`: 1 to 200
242
+
243
+ The detail endpoint also accepts `listing_id` and `capability_key`.
244
+
245
+ Important batch fields:
246
+
247
+ | Field | Meaning |
248
+ | --- | --- |
249
+ | `status` | Batch lifecycle state such as `notice_pending`, `ready`, `submitted`, `settled`, `failed`, `past_due`, or `notice_delivery_failed` |
250
+ | `notice_status` | Final debit notice delivery status |
251
+ | `period_start`, `period_end`, `close_at` | Statement period boundaries |
252
+ | `expected_scheduled_debit_at` | Expected debit time for an open period before a batch exists |
253
+ | `scheduled_debit_at` | Scheduled debit time after batch creation |
254
+ | `not_before_attempt_at` | Earliest allowed debit attempt; this is the close-plus-3-day gate |
255
+ | `execution_status` | Public execution state such as `scheduled`, `submitted_reconcile_required`, `settled`, `failed_retryable`, or `past_due` |
256
+ | `latest_execution_attempt_status` | Latest non-sensitive execution attempt status |
257
+ | `chain_receipt_id` | On-chain receipt id when available |
258
+ | `usage_event_digest` | Digest of usage rows included in the batch |
259
+ | `provider_receivable_minor` | Provider amount for the batch |
260
+ | `settled_provider_receivable_minor` | Provider amount that is settled on-chain |
261
+ | `unsettled_provider_receivable_minor` | Provider amount not yet settled |
262
+ | `past_due_provider_receivable_minor` | Provider amount blocked on past-due settlement |
263
+ | `gross_buyer_debit_minor` | Provider amount plus protocol fee |
264
+ | `protocol_fee_minor` | Micro / Nano protocol fee |
265
+ | `buyer_debit_minor` | Amount scheduled for the buyer debit |
266
+ | `attempt_count`, `next_attempt_at` | Retry state |
267
+ | `failure_reason_code`, `failure_reason_label`, `failure_reason_help` | Sanitized public failure reason |
268
+ | `support_reference` | Non-secret support reference |
269
+
270
+ Provider APIs do not expose relayer IDs, nonce values, gas data, raw RPC errors,
271
+ raw `failure_message`, buyer email, buyer wallet address, or raw `buyer_user_id`.
272
+
273
+ ### CSV Export
274
+
275
+ ```bash
276
+ curl https://siglume.com/v1/sdrp/metered/provider/settlement-batches/<batch-id>/usage-events.csv \
277
+ -H "Authorization: Bearer <provider-siglume-bearer-token>" \
278
+ -o sdrp-metered.csv
279
+ ```
280
+
281
+ The CSV contains exactly these columns:
282
+
283
+ ```text
284
+ metered_usage_id,created_at,plan_type,settlement_cadence,period_start,period_end,listing_id,capability_key,operation_key,currency,token_symbol,provider_receivable_minor,protocol_fee_minor,gross_buyer_debit_minor,rounding_delta_minor,buyer_debit_minor,status,settlement_batch_id,buyer_period_ref
285
+ ```
286
+
287
+ The CSV uses `buyer_period_ref`, not `buyer_user_id`.
288
+
289
+ ## Notifications
290
+
291
+ Siglume sends platform notifications for Micro / Nano settlement state. Your
292
+ integration should not send a buyer debit notice as if it were the source of
293
+ truth.
294
+
295
+ Buyer-facing notifications:
296
+
297
+ - estimate before close when there is chargeable usage in the period,
298
+ - final debit scheduled after period close,
299
+ - settlement failed / retry scheduled when the buyer can fix balance,
300
+ allowance, BudgetVault, or caps,
301
+ - settlement past due after automatic attempts are exhausted.
302
+
303
+ Provider-facing notifications:
304
+
305
+ - period summary / expected settlement,
306
+ - settlement succeeded,
307
+ - settlement failed / retry scheduled,
308
+ - settlement past due.
309
+
310
+ There is no provider "final debit" notice. Providers should use statement APIs
311
+ for expected and settled revenue. Standard `direct_payment.confirmed` webhooks
312
+ remain the source for immediate Standard Payment fulfillment, but they are not a
313
+ complete revenue statement for Micro / Nano aggregated settlement.
314
+
315
+ ## Failure and Retry Policy
316
+
317
+ Siglume retries failed Micro / Nano settlement every 6 hours for up to 28
318
+ automatic attempts. After that the batch remains `past_due` until operator
319
+ requeue.
320
+
321
+ New Micro / Nano usage for the same buyer, plan type, and token is paused while
322
+ the past-due block remains. The provider API is not called for the rejected
323
+ request, and the request is not charged.
324
+
325
+ Public failure fields are sanitized. Show `failure_reason_code`,
326
+ `failure_reason_label`, `failure_reason_help`, and `support_reference` to users
327
+ or support staff. Do not depend on raw platform failure messages.
328
+
329
+ ## Operational Recipes
330
+
331
+ ### "How much did we use this week or month?"
332
+
333
+ Call provider summary and read:
334
+
335
+ - `open_periods` for usage in the currently open period,
336
+ - `periods` for closed or settled periods,
337
+ - `provider_receivable_minor` on each period,
338
+ - CSV export for line-level reconciliation.
339
+
340
+ ### "When will we be paid?"
341
+
342
+ For open periods, read `expected_scheduled_debit_at`. After a batch exists, read
343
+ `scheduled_debit_at` and `not_before_attempt_at`. Actual provider revenue is
344
+ settled only when `status === "settled"` and `chain_receipt_id` is present.
345
+
346
+ ### "Why did new Micro / Nano usage stop?"
347
+
348
+ Buyer summary `past_due_blocks` returns `METERED_SETTLEMENT_PAST_DUE` with a
349
+ sanitized reason and support reference. The buyer must repair the listed balance
350
+ or authorization issue. Requeue is operator-only in the MVP.
351
+
352
+ ### "What should our accounting system book?"
353
+
354
+ Book `settled_provider_receivable_minor` as settled revenue. Keep
355
+ `unsettled_provider_receivable_minor` and `past_due_provider_receivable_minor`
356
+ separate from settled revenue.
357
+
358
+ ## Go-Live Checklist
359
+
360
+ - Your order fulfillment is idempotent by order id and requirement id.
361
+ - Standard Payment fulfillment still uses verified `direct_payment.confirmed`.
362
+ - Micro / Nano accounting uses statement APIs or CSV, not only webhooks.
363
+ - Your dashboard separates settled, unsettled, and past-due provider amounts.
364
+ - Your support UI shows sanitized failure fields and `support_reference`.
365
+ - You do not store or display raw buyer IDs from provider APIs; use
366
+ `buyer_period_ref`.
367
+ - You do not recognize Micro / Nano provider revenue before on-chain settlement.
package/docs/pricing.md CHANGED
@@ -27,13 +27,19 @@ quoted per currency.
27
27
  | Payment amount | Applied automatically | What you select | Fee | Settlement |
28
28
  | --- | --- | --- | --- | --- |
29
29
  | Over JPY 500 / over USD 3.00, or whenever immediate finality is required | Standard Payment | Select one Standard plan: Launch, Starter, Growth, or Pro | Launch: JPY 0 / USD 0 monthly, 1.8%; Starter: JPY 980 / USD 6 monthly, 1.0%; Growth: JPY 2,980 / USD 18 monthly, 0.7%; Pro: JPY 9,800 / USD 60 monthly, 0.5%. Minimum JPY 30 / USD 0.20 per payment. | Settled on-chain immediately after the payment confirms |
30
- | JPY 50-500 / about USD 0.30-3.00 | Micro Payment | Applied automatically by amount | USD 0.01 / Tx, about JPY 2 | Aggregated and settled **weekly** (see [Settlement schedule](#settlement-schedule)) |
31
- | Under JPY 1 to JPY 49 / under USD 0.01 to about USD 0.30 | Nano Payment | Applied automatically by amount | USD 0.001 / usage, about JPY 0.2 | Aggregated and settled **monthly** (see [Settlement schedule](#settlement-schedule)) |
30
+ | JPY 50-500 / over USD 0.30 and up to USD 3.00 | Micro Payment | Applied automatically by amount | USD 0.01 / Tx, about JPY 2 | Aggregated and settled **weekly** (see [Settlement schedule](#settlement-schedule)) |
31
+ | Under JPY 50 / up to USD 0.30 | Nano Payment | Applied automatically by amount | USD 0.001 / usage, about JPY 0.2 | Aggregated and settled **monthly** (see [Settlement schedule](#settlement-schedule)) |
32
32
 
33
33
  Standard Payment settles per payment. Micro Payment and Nano Payment are
34
- aggregated and settled on a fixed weekly / monthly cadence see
35
- [Settlement schedule](#settlement-schedule) for exactly when each band closes,
36
- when revenue becomes settled, and how rejected requests behave.
34
+ aggregated and settled in account-assigned weekly / monthly slots - see
35
+ [Settlement schedule](#settlement-schedule) for how each band closes, when the
36
+ pre-debit notice site elapses, when revenue becomes settled, and how rejected
37
+ requests behave.
38
+
39
+ For the operational statement APIs, CSV export, buyer past-due blocks, and the
40
+ field-by-field meaning of `scheduled_debit_at`, `not_before_attempt_at`,
41
+ `execution_status`, and `buyer_period_ref`, see
42
+ [Micro / Nano Statements and Notices](./metered-statements.md).
37
43
 
38
44
  USD pricing is the JPY tier converted at roughly 160 JPY/USD and rounded to
39
45
  clean price points that keep the same 1:3:10 tier ratio.
@@ -59,8 +65,8 @@ confirmed payment turns into money in your settlement wallet.
59
65
  | Band | Cadence | Period | You are paid |
60
66
  | --- | --- | --- | --- |
61
67
  | Standard Payment | Per payment | n/a | On-chain, immediately after each payment confirms |
62
- | Micro Payment | Weekly | Fixed weekly slot assigned per account | After the period closes, after the final notice and an approximately 3-day pre-debit notice site, in aggregated on-chain settlement(s) grouped per buyer, payee, token, and period |
63
- | Nano Payment | Monthly | Fixed monthly slot assigned per account | After the period closes, after the final notice and an approximately 3-day pre-debit notice site, in aggregated on-chain settlement(s) grouped per buyer, payee, token, and period |
68
+ | Micro Payment | Weekly | Account-assigned fixed weekly slot in the buyer settlement timezone; the assigned close time is visible through the statement APIs | After the period closes and the roughly 3-day pre-debit notice site has elapsed, in aggregated on-chain settlement(s) grouped per buyer, payee, token, and period |
69
+ | Nano Payment | Monthly | Account-assigned fixed monthly slot in the buyer settlement timezone; the assigned close time is visible through the statement APIs | After the period closes and the roughly 3-day pre-debit notice site has elapsed, in aggregated on-chain settlement(s) grouped per buyer, payee, token, and period |
64
70
 
65
71
  ### Micro weekly settlement
66
72
 
@@ -122,18 +128,33 @@ Micro and Nano run a budget check before the buyer's paid request is fulfilled:
122
128
  accrued, and nothing is added to a settlement. A buyer near their budget
123
129
  ceiling can have a request rejected even though earlier requests in the same
124
130
  period succeeded.
125
- - Treat Siglume's settled status and webhooks as the source of truth for what has
126
- actually been paid.
131
+ - Treat Siglume's statement status, `settled_at`, and `chain_receipt_id` as the
132
+ source of truth for Micro / Nano provider revenue. Webhooks are still required
133
+ for fulfillment, but they are not the complete Micro / Nano settlement ledger.
127
134
 
128
135
  ### What is fixed vs platform-managed
129
136
 
130
137
  The cadence is fixed: **Micro settles weekly, Nano settles monthly**, and a
131
- payment is final only after its on-chain settlement confirms. The buyer-timezone
132
- period boundaries and the current retry policy above are the public behavior as
133
- of 2026-06-18. The scheduler lag between a period close and the on-chain
134
- transaction is platform-managed; treat the platform's settlement status and
135
- `fee_bps` response as authoritative rather than hard-coding local revenue
136
- recognition.
138
+ payment is final only after its on-chain settlement confirms. Micro and Nano are
139
+ automatic amount bands, not customer-selected options. The account-assigned
140
+ period boundaries, roughly 3-day pre-debit notice site, and current retry policy
141
+ above are the public behavior as of 2026-06-18. Treat the platform's statement
142
+ status, `not_before_attempt_at`, and `fee_bps` response as authoritative rather
143
+ than hard-coding local revenue recognition.
144
+
145
+ ## Statement APIs and Notices
146
+
147
+ Micro and Nano require operational reconciliation after usage is accepted. The
148
+ payment requirement response tells you the immediate payment requirement state,
149
+ but it does not replace the Micro / Nano statement APIs.
150
+
151
+ Use [Micro / Nano Statements and Notices](./metered-statements.md) to integrate:
152
+
153
+ - provider summary of open, settled, unsettled, and past-due revenue,
154
+ - provider usage-event CSV export,
155
+ - buyer summaries for open-period estimated debit and past-due blocks,
156
+ - sanitized public failure reasons and support references,
157
+ - the fixed final notice plus close-plus-3-day debit site.
137
158
 
138
159
  ## SDK Behavior
139
160
 
package/docs/security.md CHANGED
@@ -114,6 +114,31 @@ Fulfill exactly once per order. Store at least:
114
114
  Duplicate webhook deliveries and manual redelivery can occur. A duplicate
115
115
  webhook with the same requirement id must not ship the order twice.
116
116
 
117
+ ## Micro / Nano Statement Privacy
118
+
119
+ Micro Payment and Nano Payment introduce operational statement APIs and CSV
120
+ exports because revenue is settled later in aggregated on-chain batches.
121
+
122
+ Provider-facing statement APIs intentionally do not expose raw `buyer_user_id`,
123
+ buyer email, buyer wallet address, relayer id, nonce, gas data, raw RPC errors,
124
+ or raw platform failure messages. Use `buyer_period_ref` for provider-side
125
+ reconciliation within a statement period, and show only the sanitized public
126
+ failure fields:
127
+
128
+ - `failure_reason_code`
129
+ - `failure_reason_label`
130
+ - `failure_reason_help`
131
+ - `support_reference`
132
+
133
+ Buyer-facing APIs may include past-due block reasons and balance / allowance /
134
+ BudgetVault sufficiency indicators for the buyer's own account. Do not forward
135
+ those buyer-account details to providers.
136
+
137
+ Webhooks remain required for fulfillment, but webhooks alone are not a complete
138
+ Micro / Nano revenue ledger. Use the statement APIs or CSV in
139
+ [Micro / Nano Statements and Notices](./metered-statements.md) to separate
140
+ settled, unsettled, and past-due provider amounts.
141
+
117
142
  ## What Direct Request Payment Is Not
118
143
 
119
144
  Direct Request Payment is not:
@@ -125,12 +150,12 @@ Direct Request Payment is not:
125
150
  - a card payment fallback
126
151
 
127
152
  Each payment is an individual wallet payment backed by an on-chain receipt. Small
128
- payments in the Micro and Nano amount bands are aggregated and settled on a
129
- weekly / monthly cadence instead of one transaction at a time (see the
130
- [pricing guide](./pricing.md#settlement-schedule)), but they are still wallet
131
- payments, not a stored balance. Before a small payment is fulfilled, Siglume
132
- checks the buyer's wallet budget and fails closed when it is invalid, so a
133
- rejected request is never charged. Provider revenue for Micro and Nano remains
134
- unsettled until the weekly or monthly on-chain settlement succeeds; Siglume does
135
- not advance or guarantee revenue when a buyer's balance, allowance, BudgetVault
153
+ payments in the Micro and Nano amount bands are aggregated and settled on
154
+ account-assigned weekly / monthly slots instead of one transaction at a time
155
+ (see the [pricing guide](./pricing.md#settlement-schedule)), but they are still
156
+ wallet payments, not a stored balance. Before a small payment is fulfilled,
157
+ Siglume checks the buyer's wallet budget and fails closed when it is invalid, so
158
+ a rejected request is never charged. Provider revenue for Micro and Nano remains
159
+ unsettled until the aggregated on-chain settlement succeeds; Siglume does not
160
+ advance or guarantee revenue when a buyer's balance, allowance, BudgetVault
136
161
  authorization, cap, or on-chain transaction fails.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@siglume/direct-request-payment",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "SDK for the Siglume Direct Request Payment SDRP payment protocol",
5
5
  "keywords": [
6
6
  "siglume",