@siglume/direct-request-payment 0.4.15 → 0.4.17

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.
@@ -19,8 +19,8 @@ Siglume applies the settlement band from the amount.
19
19
 
20
20
  | Band | Cadence | Period close | First debit attempt | Revenue recognition |
21
21
  | --- | --- | --- | --- | --- |
22
- | Micro Payment | Weekly, with early threshold settlement | Account-assigned fixed weekly slot in the buyer settlement timezone; can close early once the buyer/payee/token batch reaches JPY 10,000 or USD 100.00 | After final debit notice delivery and the fixed close-plus-3-day window | Only after the aggregated settlement confirms on-chain |
23
- | Nano Payment | Monthly, with early threshold settlement | Account-assigned fixed monthly slot in the buyer settlement timezone; can close early once the buyer/payee/token batch reaches JPY 10,000 or USD 100.00 | After final debit notice delivery and the fixed close-plus-3-day window | Only after the aggregated settlement confirms on-chain |
22
+ | Micro Payment | Weekly, with early threshold settlement | Account-assigned fixed weekly slot in the buyer settlement timezone; can close early once the same buyer / provider / token / pricing band reaches JPY 10,000 or USD 100.00 | After final debit notice delivery and the fixed close-plus-3-day window | Only after the aggregated settlement confirms on-chain |
23
+ | Nano Payment | Monthly, with early threshold settlement | Account-assigned fixed monthly slot in the buyer settlement timezone; can close early once the same buyer / provider / token / pricing band reaches JPY 10,000 or USD 100.00 | After final debit notice delivery and the fixed close-plus-3-day window | Only after the aggregated settlement confirms on-chain |
24
24
 
25
25
  The schedule is platform-managed. Buyers and providers can see the resulting
26
26
  batch period and scheduled attempt times through the statement APIs, but cannot
@@ -248,7 +248,9 @@ Use:
248
248
  - `totals.unsettled_provider_receivable_minor` for expected but not yet settled
249
249
  revenue,
250
250
  - `totals.past_due_provider_receivable_minor` for provider revenue blocked on a
251
- past-due buyer settlement.
251
+ past-due buyer settlement,
252
+ - `totals.terminal_provider_receivable_minor` for provider receivable that an
253
+ operator has marked `uncollectible` or `written_off` after past-due review.
252
254
 
253
255
  ### Usage Events
254
256
 
@@ -310,7 +312,7 @@ Important batch fields:
310
312
 
311
313
  | Field | Meaning |
312
314
  | --- | --- |
313
- | `status` | Batch lifecycle state such as `notice_pending`, `ready`, `submitted`, `settled`, `failed`, `past_due`, or `notice_delivery_failed` |
315
+ | `status` | Batch lifecycle state such as `notice_pending`, `ready`, `submitted`, `settled`, `failed`, `past_due`, `uncollectible`, `written_off`, or `notice_delivery_failed` |
314
316
  | `notice_status` | Final debit notice delivery status |
315
317
  | `period_start`, `period_end`, `close_at` | Statement period boundaries |
316
318
  | `settlement_trigger` | `amount_threshold` for early threshold close, or `scheduled_close` for weekly/monthly close |
@@ -330,6 +332,10 @@ Important batch fields:
330
332
  | `settled_provider_receivable_minor` | Provider receivable that is settled on-chain |
331
333
  | `unsettled_provider_receivable_minor` | Provider receivable not yet settled |
332
334
  | `past_due_provider_receivable_minor` | Provider receivable blocked on past-due settlement |
335
+ | `terminal_provider_receivable_minor` | Provider receivable marked terminal after operator review |
336
+ | `uncollectible_provider_receivable_minor` | Terminal provider receivable classified as uncollectible |
337
+ | `written_off_provider_receivable_minor` | Terminal provider receivable classified as written off |
338
+ | `terminal_status`, `terminal_marked_at`, `terminal_reason_code` | Public terminal resolution fields, present only for terminal batches |
333
339
  | `gross_buyer_debit_minor` | Legacy alias of provider gross; protocol fee is not added |
334
340
  | `protocol_fee_minor` | Micro / Nano protocol fee deducted from provider receivable |
335
341
  | `buyer_debit_minor` | Amount scheduled for the buyer debit; equals provider gross |
@@ -472,13 +478,24 @@ settled only when `status === "settled"` and `chain_receipt_id` is present.
472
478
 
473
479
  Buyer summary `past_due_blocks` returns `METERED_SETTLEMENT_PAST_DUE` with a
474
480
  sanitized reason and support reference. The buyer must repair the listed balance
475
- or authorization issue. Requeue is operator-only in the MVP.
481
+ or authorization issue. Requeue is operator-only in the MVP. If operator review
482
+ marks a past-due batch `uncollectible` or `written_off`, new usage may resume,
483
+ but the provider receivable moves to terminal accounting instead of settled,
484
+ unsettled, or past-due revenue.
485
+
486
+ If the same execution idempotency key is reused with a different Micro / Nano
487
+ input payload, the platform fails closed before provider execution with
488
+ `IDEMPOTENCY_KEY_REUSED_WITH_DIFFERENT_PAYLOAD` and HTTP status `409`.
476
489
 
477
490
  ### "What should our accounting system book?"
478
491
 
479
492
  Book `settled_provider_receivable_minor` as settled revenue. Keep
480
493
  `unsettled_provider_receivable_minor` and `past_due_provider_receivable_minor`
481
- separate from settled revenue.
494
+ separate from settled revenue. Keep
495
+ `terminal_provider_receivable_minor`, `uncollectible_provider_receivable_minor`,
496
+ and `written_off_provider_receivable_minor` outside settled, unsettled, and
497
+ past-due revenue; they represent operator terminal resolution, not successful
498
+ on-chain settlement.
482
499
 
483
500
  ## Go-Live Checklist
484
501
 
@@ -488,6 +505,8 @@ separate from settled revenue.
488
505
  `settlement_status` show settled per-payment finality.
489
506
  - Micro / Nano accounting uses statement APIs or CSV, not only webhooks.
490
507
  - Your dashboard separates settled, unsettled, and past-due provider amounts.
508
+ - Your dashboard separates terminal `uncollectible` / `written_off` provider
509
+ amounts from settled, unsettled, and past-due revenue.
491
510
  - Your support UI shows sanitized failure fields and `support_reference`.
492
511
  - You do not store or display raw buyer IDs from provider APIs; use
493
512
  `buyer_period_ref`.
package/docs/pricing.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Pricing
2
2
 
3
3
  This page documents the trial-phase merchant pricing for Siglume Direct Request
4
- Payment as of 2026-06-18. Pricing can change by agreement or future product
4
+ Payment as of SDK v0.4.17. Pricing can change by agreement or future product
5
5
  release; the Siglume platform response is the source of truth for per-payment
6
6
  fee data returned at runtime.
7
7
 
@@ -14,12 +14,13 @@ delayed aggregated settlement whenever they offer amounts in those bands.
14
14
  ## Settlement Currencies
15
15
 
16
16
  Siglume Direct Request Payment launches in the US and Japan, and both settlement
17
- currencies are first-class:
17
+ currencies are first-class where enabled:
18
18
 
19
19
  - **JPY**, settled on-chain in **JPYC**
20
20
  - **USD**, settled on-chain in **USDC**
21
21
 
22
- A merchant settles in a single currency, chosen at onboarding. The settlement fee
22
+ A merchant settles in a single currency, chosen at onboarding. Some accounts may
23
+ require agreed USD/USDC terms before USD is enabled. The settlement fee
23
24
  percentage (the payment fee column below) is identical in both currencies. Only
24
25
  the flat amounts — the monthly base fee and the per-payment minimum fee — are
25
26
  quoted per currency.
@@ -34,8 +35,8 @@ charging.
34
35
  | Public one-time payment amount | Applied automatically | What you select | Fee | Settlement |
35
36
  | --- | --- | --- | --- | --- |
36
37
  | JPY 501+ / USD 3.01+ | 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 |
37
- | JPY 50-500 / USD 0.31-3.00 | Micro Payment | Applied automatically by amount | JPY 2 / USD 0.01 per SDRP Tx | Aggregated and settled **weekly**, or earlier once the buyer/payee batch reaches JPY 10,000 / USD 100.00 (see [Settlement schedule](#settlement-schedule)) |
38
- | JPY 1-49 / USD 0.01-0.30 | Nano Payment | Applied automatically by amount | JPY 0.2 / USD 0.001 per SDRP Tx | Aggregated and settled **monthly**, or earlier once the buyer/payee batch reaches JPY 10,000 / USD 100.00 (see [Settlement schedule](#settlement-schedule)) |
38
+ | JPY 50-500 / USD 0.31-3.00 | Micro Payment | Applied automatically by amount | JPY 2 / USD 0.01 per SDRP Tx | Aggregated and settled **weekly**, or earlier once the same buyer / provider / token / pricing band reaches JPY 10,000 / USD 100.00 (see [Settlement schedule](#settlement-schedule)) |
39
+ | JPY 1-49 / USD 0.01-0.30 | Nano Payment | Applied automatically by amount | JPY 0.2 / USD 0.001 per SDRP Tx | Aggregated and settled **monthly**, or earlier once the same buyer / provider / token / pricing band reaches JPY 10,000 / USD 100.00 (see [Settlement schedule](#settlement-schedule)) |
39
40
 
40
41
  In this table, `Tx` means one accepted SDRP payment, not an on-chain settlement
41
42
  transaction. Micro / Nano settlement batches are aggregated on-chain after the
@@ -43,8 +44,8 @@ weekly or monthly close, or earlier when the fixed amount threshold is reached.
43
44
 
44
45
  Standard Payment settles per payment. Micro Payment and Nano Payment are
45
46
  aggregated and settled in account-assigned weekly / monthly slots, with early
46
- settlement when the same buyer/payee/token/period batch reaches JPY 10,000 or
47
- USD 100.00. See [Settlement schedule](#settlement-schedule) for how each band
47
+ settlement when the same buyer / provider / token / pricing band reaches JPY
48
+ 10,000 or USD 100.00. See [Settlement schedule](#settlement-schedule) for how each band
48
49
  closes, when the pre-debit notice window elapses, when revenue becomes settled,
49
50
  and how rejected requests behave.
50
51
 
@@ -65,8 +66,9 @@ field-by-field meaning of `scheduled_debit_at`, `not_before_attempt_at`,
65
66
  `execution_status`, and `buyer_period_ref`, see
66
67
  [Micro / Nano Statements and Notices](./metered-statements.md).
67
68
 
68
- USD pricing is the JPY tier converted at roughly 160 JPY/USD and rounded to
69
- clean price points that keep the same 1:3:10 tier ratio.
69
+ USD plan prices are set as separate public price points. The JPY 10,000 and USD
70
+ 100.00 Micro / Nano early-settlement thresholds are fixed market thresholds,
71
+ not FX conversions of one another.
70
72
 
71
73
  If no paid plan is selected during merchant setup, the merchant account uses the
72
74
  Launch plan. A merchant billing mandate is still required before accepting
@@ -95,25 +97,25 @@ confirmed payment turns into money in your settlement wallet.
95
97
  | Band | Cadence | Period | You are paid |
96
98
  | --- | --- | --- | --- |
97
99
  | Standard Payment | Per payment | n/a | On-chain, immediately after each payment confirms |
98
- | Micro Payment | Weekly, with early threshold settlement | Account-assigned fixed weekly slot in the buyer settlement timezone; the assigned close time is visible through the statement APIs. If a buyer/payee/token/period batch reaches JPY 10,000 or USD 100.00 first, Siglume can close that batch early. | After the period closes or the fixed amount threshold is reached, and the roughly 3-day pre-debit notice window has elapsed, in aggregated on-chain settlement(s) grouped per buyer, payee, token, and period |
99
- | Nano Payment | Monthly, with early threshold settlement | Account-assigned fixed monthly slot in the buyer settlement timezone; the assigned close time is visible through the statement APIs. If a buyer/payee/token/period batch reaches JPY 10,000 or USD 100.00 first, Siglume can close that batch early. | After the period closes or the fixed amount threshold is reached, and the roughly 3-day pre-debit notice window has elapsed, in aggregated on-chain settlement(s) grouped per buyer, payee, token, and period |
100
+ | Micro Payment | Weekly, with early threshold settlement | Account-assigned fixed weekly slot in the buyer settlement timezone; the assigned close time is visible through the statement APIs. If the same buyer / provider / token / pricing band reaches JPY 10,000 or USD 100.00 first, Siglume can close that batch early. | After the period closes or the fixed amount threshold is reached, and the roughly 3-day pre-debit notice window has elapsed, in aggregated on-chain settlement(s) grouped per buyer, provider, token, pricing band, and period |
101
+ | Nano Payment | Monthly, with early threshold settlement | Account-assigned fixed monthly slot in the buyer settlement timezone; the assigned close time is visible through the statement APIs. If the same buyer / provider / token / pricing band reaches JPY 10,000 or USD 100.00 first, Siglume can close that batch early. | After the period closes or the fixed amount threshold is reached, and the roughly 3-day pre-debit notice window has elapsed, in aggregated on-chain settlement(s) grouped per buyer, provider, token, pricing band, and period |
100
102
 
101
103
  ### Micro weekly settlement
102
104
 
103
105
  - **Closing period.** Micro-band payments accrue across one weekly period. The
104
106
  specific closing weekday and time are assigned as a fixed slot per account to
105
107
  spread settlement load.
106
- - **Early threshold settlement.** If a buyer/payee/token batch reaches JPY
107
- 10,000 or USD 100.00 before the weekly close, Siglume can close that batch
108
- early and start the same final-notice and settlement flow. JPY 10,000 and USD
109
- 100.00 are market-specific fixed thresholds, not FX conversions of one
110
- another.
108
+ - **Early threshold settlement.** If the same buyer / provider / token /
109
+ pricing band reaches JPY 10,000 or USD 100.00 before the weekly close,
110
+ Siglume can close that batch early and start the same final-notice and
111
+ settlement flow. JPY 10,000 and USD 100.00 are market-specific fixed
112
+ thresholds, not FX conversions of one another.
111
113
  - **Timezone.** Period boundaries are evaluated in the buyer's configured
112
114
  settlement timezone, defaulting to UTC. Assigned slots are persisted and are
113
115
  not recalculated on the fly.
114
116
  - **Settlement.** After the week closes or the early threshold is reached,
115
117
  Siglume aggregates the Micro
116
- payments — grouped per buyer, payee, token, and period — into on-chain
118
+ payments — grouped per buyer, provider, token, pricing band, and period — into on-chain
117
119
  settlement(s). Siglume sends the final debit notice first; the on-chain debit
118
120
  is not attempted until the scheduled attempt time after an approximately
119
121
  3-day pre-debit notice window (`not_before_attempt_at`).
@@ -125,17 +127,17 @@ confirmed payment turns into money in your settlement wallet.
125
127
  - **Closing period.** Nano-band payments accrue across one monthly period. The
126
128
  specific closing day and time are assigned as a fixed slot per account to
127
129
  spread settlement load.
128
- - **Early threshold settlement.** If a buyer/payee/token batch reaches JPY
129
- 10,000 or USD 100.00 before the monthly close, Siglume can close that batch
130
- early and start the same final-notice and settlement flow. JPY 10,000 and USD
131
- 100.00 are market-specific fixed thresholds, not FX conversions of one
132
- another.
130
+ - **Early threshold settlement.** If the same buyer / provider / token /
131
+ pricing band reaches JPY 10,000 or USD 100.00 before the monthly close,
132
+ Siglume can close that batch early and start the same final-notice and
133
+ settlement flow. JPY 10,000 and USD 100.00 are market-specific fixed
134
+ thresholds, not FX conversions of one another.
133
135
  - **Timezone.** As with Micro, period boundaries use the buyer's configured
134
136
  settlement timezone, defaulting to UTC. Assigned slots are persisted and are
135
137
  not recalculated on the fly.
136
138
  - **Settlement.** After the month closes or the early threshold is reached,
137
139
  Siglume aggregates the Nano
138
- payments — grouped per buyer, payee, token, and period — into on-chain
140
+ payments — grouped per buyer, provider, token, pricing band, and period — into on-chain
139
141
  settlement(s). Siglume sends the final debit notice first; the on-chain debit
140
142
  is not attempted until the scheduled attempt time after an approximately
141
143
  3-day pre-debit notice window (`not_before_attempt_at`).
@@ -233,12 +235,17 @@ but it does not replace the Micro / Nano statement APIs.
233
235
 
234
236
  Use [Micro / Nano Statements and Notices](./metered-statements.md) to integrate:
235
237
 
236
- - provider summary of open, settled, unsettled, and past-due revenue,
238
+ - provider summary of open, settled, unsettled, past-due, and terminal
239
+ `uncollectible` / `written_off` revenue buckets,
237
240
  - provider usage-event CSV export,
238
241
  - buyer summaries for open-period estimated debit and past-due blocks,
239
242
  - sanitized public failure reasons and support references,
240
243
  - the fixed final notice plus close-plus-3-day debit window.
241
244
 
245
+ Reusing the same Micro / Nano execution idempotency key with a different input
246
+ payload fails closed before provider execution with
247
+ `IDEMPOTENCY_KEY_REUSED_WITH_DIFFERENT_PAYLOAD` and HTTP status `409`.
248
+
242
249
  ## SDK Behavior
243
250
 
244
251
  The SDK does not calculate merchant invoices or enforce plan limits locally.
@@ -130,7 +130,9 @@ app.post("/siglume/webhook", express.raw({ type: "application/json" }), asyncRou
130
130
  app.use((error: unknown, _req: express.Request, res: express.Response, _next: express.NextFunction) => {
131
131
  // Log the detail server-side; never return raw error messages to the client —
132
132
  // a payment error can otherwise leak internal API details or configuration.
133
- console.error("checkout error:", error);
133
+ console.error("checkout error:", {
134
+ name: error instanceof Error ? error.name : "Error",
135
+ });
134
136
  res.status(500).json({ error: "internal_error" });
135
137
  });
136
138
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@siglume/direct-request-payment",
3
- "version": "0.4.15",
3
+ "version": "0.4.17",
4
4
  "description": "SDK for the Siglume Direct Request Payment SDRP payment protocol",
5
5
  "keywords": [
6
6
  "siglume",