@siglume/direct-request-payment 0.4.2 → 0.4.4
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.
- package/CHANGELOG.md +33 -0
- package/README.md +34 -10
- package/dist/index.cjs +120 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +142 -1
- package/dist/index.d.ts +142 -1
- package/dist/index.js +120 -6
- package/dist/index.js.map +1 -1
- package/docs/announcement-ja.md +12 -12
- package/docs/api-reference.md +236 -11
- package/docs/merchant-quickstart.md +65 -7
- package/docs/metered-statements.md +433 -0
- package/docs/pricing.md +87 -27
- package/docs/security.md +44 -8
- package/examples/express-checkout.ts +12 -30
- package/package.json +1 -1
|
@@ -0,0 +1,433 @@
|
|
|
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 window | 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 window | 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 and Python expose named helpers for the JSON statement endpoints.
|
|
49
|
+
Use raw HTTPS only for the CSV export.
|
|
50
|
+
|
|
51
|
+
## Buyer Statement APIs
|
|
52
|
+
|
|
53
|
+
### Summary
|
|
54
|
+
|
|
55
|
+
TypeScript:
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
import { DirectRequestPaymentClient } from "@siglume/direct-request-payment";
|
|
59
|
+
|
|
60
|
+
const siglume = new DirectRequestPaymentClient({
|
|
61
|
+
auth_token: buyerSiglumeBearerToken,
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
const summary = await siglume.getBuyerMeteredSummary({
|
|
65
|
+
plan_type: "micro",
|
|
66
|
+
token_symbol: "JPYC",
|
|
67
|
+
});
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Python:
|
|
71
|
+
|
|
72
|
+
```py
|
|
73
|
+
summary = siglume.get_buyer_metered_summary(plan_type="micro", token_symbol="JPYC")
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Raw HTTP:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
curl https://siglume.com/v1/sdrp/metered/my-summary?plan_type=micro\&token_symbol=JPYC \
|
|
80
|
+
-H "Authorization: Bearer <buyer-siglume-bearer-token>"
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Use `open_periods` to show current-period estimated debit. Use
|
|
84
|
+
`settlement_batches` for closed or already scheduled periods. Use
|
|
85
|
+
`past_due_blocks` to explain why new Micro / Nano usage is blocked.
|
|
86
|
+
|
|
87
|
+
`balance_sufficiency` is a cheap current-state indicator. When available, it
|
|
88
|
+
checks whether BudgetVault status and configured caps look sufficient for the
|
|
89
|
+
open period. It can report `wallet_balance_checked: false` or
|
|
90
|
+
`allowance_checked: false`; in that case it is guidance, not a final on-chain
|
|
91
|
+
guarantee.
|
|
92
|
+
|
|
93
|
+
## Amount Rounding
|
|
94
|
+
|
|
95
|
+
Micro / Nano usage rows keep provider price and protocol fee values as decimal
|
|
96
|
+
minor-unit amounts. This allows Nano fees such as about JPY 0.2 per usage to be
|
|
97
|
+
accounted without rounding every event.
|
|
98
|
+
|
|
99
|
+
Rounding happens once when a settlement batch is created:
|
|
100
|
+
|
|
101
|
+
```text
|
|
102
|
+
provider_usage_amount_minor = sum(provider price minor units for accepted usage)
|
|
103
|
+
protocol_fee_minor = sum(Micro/Nano fixed protocol fee minor units for accepted usage)
|
|
104
|
+
gross_buyer_debit_minor = provider_usage_amount_minor + protocol_fee_minor
|
|
105
|
+
buyer_debit_minor = ceil(gross_buyer_debit_minor)
|
|
106
|
+
rounding_delta_minor = buyer_debit_minor - gross_buyer_debit_minor
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
`rounding_delta_minor` belongs to the buyer debit and Siglume's rounding
|
|
110
|
+
adjustment accounting for that batch. It is not provider revenue. Provider
|
|
111
|
+
reports should use `provider_receivable_minor`,
|
|
112
|
+
`settled_provider_receivable_minor`, `unsettled_provider_receivable_minor`, and
|
|
113
|
+
`past_due_provider_receivable_minor`.
|
|
114
|
+
|
|
115
|
+
### Usage Events
|
|
116
|
+
|
|
117
|
+
```text
|
|
118
|
+
GET /v1/sdrp/metered/my-usage-events
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Query parameters:
|
|
122
|
+
|
|
123
|
+
- `plan_type`: `micro` or `nano`
|
|
124
|
+
- `token_symbol`: `JPYC` or `USDC`
|
|
125
|
+
- `status`: for example `pending_settlement`, `settled`, `failed_chargeable`
|
|
126
|
+
- `limit`: 1 to 500
|
|
127
|
+
|
|
128
|
+
SDK methods: `listBuyerUsageEvents(...)` / `list_buyer_usage_events(...)`.
|
|
129
|
+
They return `{items, next_cursor}`.
|
|
130
|
+
|
|
131
|
+
Buyer usage event amount fields:
|
|
132
|
+
|
|
133
|
+
- `provider_usage_amount_minor`: provider price for the usage event
|
|
134
|
+
- `protocol_fee_minor`: metered protocol fee
|
|
135
|
+
- `gross_buyer_debit_minor`: expected buyer debit for the event
|
|
136
|
+
- `expected_scheduled_debit_at`: derived schedule for an open period before a
|
|
137
|
+
settlement batch exists
|
|
138
|
+
|
|
139
|
+
### Settlement Batches
|
|
140
|
+
|
|
141
|
+
```text
|
|
142
|
+
GET /v1/sdrp/metered/my-settlement-batches
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Query parameters:
|
|
146
|
+
|
|
147
|
+
- `plan_type`: `micro` or `nano`
|
|
148
|
+
- `token_symbol`: `JPYC` or `USDC`
|
|
149
|
+
- `status`: `notice_pending`, `ready`, `submitted`, `settled`, `failed`,
|
|
150
|
+
`past_due`, or `notice_delivery_failed`
|
|
151
|
+
- `limit`: 1 to 200
|
|
152
|
+
|
|
153
|
+
SDK methods: `listBuyerSettlementBatches(...)` /
|
|
154
|
+
`list_buyer_settlement_batches(...)`. They return `{items, next_cursor}`.
|
|
155
|
+
|
|
156
|
+
Buyer batch amount fields:
|
|
157
|
+
|
|
158
|
+
- `estimated_buyer_debit_minor`: total buyer debit for the batch
|
|
159
|
+
- `provider_usage_amount_minor`: provider usage amount before protocol fee
|
|
160
|
+
- `gross_buyer_debit_minor`: provider usage amount plus protocol fee
|
|
161
|
+
- `buyer_debit_minor`: amount scheduled for the debit transaction
|
|
162
|
+
|
|
163
|
+
Past-due batches include:
|
|
164
|
+
|
|
165
|
+
- `past_due_block_reason`: `METERED_SETTLEMENT_PAST_DUE`
|
|
166
|
+
- `failure_reason_code`
|
|
167
|
+
- `failure_reason_label`
|
|
168
|
+
- `failure_reason_help`
|
|
169
|
+
- `support_reference`
|
|
170
|
+
|
|
171
|
+
Buyer-triggered requeue is not part of the MVP. The buyer-facing UI should show
|
|
172
|
+
the block reason, tell the buyer to repair balance / allowance / BudgetVault /
|
|
173
|
+
caps, and point them to support with `support_reference`.
|
|
174
|
+
|
|
175
|
+
## Provider Statement APIs
|
|
176
|
+
|
|
177
|
+
### Summary
|
|
178
|
+
|
|
179
|
+
TypeScript:
|
|
180
|
+
|
|
181
|
+
```ts
|
|
182
|
+
const siglume = new DirectRequestPaymentClient({
|
|
183
|
+
auth_token: providerSiglumeBearerToken,
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
const providerSummary = await siglume.getProviderMeteredSummary({
|
|
187
|
+
plan_type: "micro",
|
|
188
|
+
token_symbol: "JPYC",
|
|
189
|
+
});
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Python:
|
|
193
|
+
|
|
194
|
+
```py
|
|
195
|
+
provider_summary = siglume.get_provider_metered_summary(plan_type="micro", token_symbol="JPYC")
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Raw HTTP:
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
curl https://siglume.com/v1/sdrp/metered/provider/summary?plan_type=micro\&token_symbol=JPYC \
|
|
202
|
+
-H "Authorization: Bearer <provider-siglume-bearer-token>"
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Query parameters:
|
|
206
|
+
|
|
207
|
+
- `plan_type`: `micro` or `nano`
|
|
208
|
+
- `token_symbol`: `JPYC` or `USDC`
|
|
209
|
+
- `listing_id`: restrict to one listing
|
|
210
|
+
- `capability_key`: restrict to one capability
|
|
211
|
+
|
|
212
|
+
Use:
|
|
213
|
+
|
|
214
|
+
- `open_periods` for current-period expected revenue before a batch exists,
|
|
215
|
+
- `periods` for closed, scheduled, retrying, past-due, submitted, or settled
|
|
216
|
+
batches,
|
|
217
|
+
- `totals.settled_provider_receivable_minor` for revenue already settled,
|
|
218
|
+
- `totals.unsettled_provider_receivable_minor` for expected but not yet settled
|
|
219
|
+
revenue,
|
|
220
|
+
- `totals.past_due_provider_receivable_minor` for provider revenue blocked on a
|
|
221
|
+
past-due buyer settlement.
|
|
222
|
+
|
|
223
|
+
### Usage Events
|
|
224
|
+
|
|
225
|
+
```text
|
|
226
|
+
GET /v1/sdrp/metered/provider/usage-events
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
Query parameters:
|
|
230
|
+
|
|
231
|
+
- `plan_type`
|
|
232
|
+
- `token_symbol`
|
|
233
|
+
- `status`
|
|
234
|
+
- `listing_id`
|
|
235
|
+
- `capability_key`
|
|
236
|
+
- `limit`: 1 to 500
|
|
237
|
+
|
|
238
|
+
SDK methods: `listProviderUsageEvents(...)` /
|
|
239
|
+
`list_provider_usage_events(...)`. They return `{items, next_cursor}`.
|
|
240
|
+
|
|
241
|
+
Provider usage event fields include:
|
|
242
|
+
|
|
243
|
+
- `provider_receivable_minor`
|
|
244
|
+
- `protocol_fee_minor`
|
|
245
|
+
- `gross_buyer_debit_minor`
|
|
246
|
+
- `period_start`
|
|
247
|
+
- `period_end`
|
|
248
|
+
- `expected_scheduled_debit_at`
|
|
249
|
+
- `settlement_batch_id`
|
|
250
|
+
- `buyer_period_ref`
|
|
251
|
+
|
|
252
|
+
`buyer_period_ref` is the only buyer correlation identifier exposed to
|
|
253
|
+
providers. Do not expect raw buyer account IDs in provider APIs.
|
|
254
|
+
|
|
255
|
+
### Settlement Batches
|
|
256
|
+
|
|
257
|
+
```text
|
|
258
|
+
GET /v1/sdrp/metered/provider/settlement-batches
|
|
259
|
+
GET /v1/sdrp/metered/provider/settlement-batches/{settlement_batch_id}
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
Query parameters for the list endpoint:
|
|
263
|
+
|
|
264
|
+
- `plan_type`
|
|
265
|
+
- `token_symbol`
|
|
266
|
+
- `status`
|
|
267
|
+
- `listing_id`
|
|
268
|
+
- `capability_key`
|
|
269
|
+
- `limit`: 1 to 200
|
|
270
|
+
|
|
271
|
+
The detail endpoint also accepts `listing_id` and `capability_key`.
|
|
272
|
+
|
|
273
|
+
SDK methods: `listProviderSettlementBatches(...)` /
|
|
274
|
+
`list_provider_settlement_batches(...)` and `getProviderSettlementBatch(...)` /
|
|
275
|
+
`get_provider_settlement_batch(...)`. List methods return `{items, next_cursor}`.
|
|
276
|
+
|
|
277
|
+
Important batch fields:
|
|
278
|
+
|
|
279
|
+
| Field | Meaning |
|
|
280
|
+
| --- | --- |
|
|
281
|
+
| `status` | Batch lifecycle state such as `notice_pending`, `ready`, `submitted`, `settled`, `failed`, `past_due`, or `notice_delivery_failed` |
|
|
282
|
+
| `notice_status` | Final debit notice delivery status |
|
|
283
|
+
| `period_start`, `period_end`, `close_at` | Statement period boundaries |
|
|
284
|
+
| `expected_scheduled_debit_at` | Expected debit time for an open period before a batch exists |
|
|
285
|
+
| `scheduled_debit_at` | Scheduled debit time after batch creation |
|
|
286
|
+
| `not_before_attempt_at` | Earliest allowed debit attempt; this is the close-plus-3-day gate |
|
|
287
|
+
| `execution_status` | Public execution state such as `scheduled`, `submitted_reconcile_required`, `settled`, `failed_retryable`, or `past_due` |
|
|
288
|
+
| `latest_execution_attempt_status` | Latest non-sensitive execution attempt status |
|
|
289
|
+
| `chain_receipt_id` | On-chain receipt id when available |
|
|
290
|
+
| `usage_event_digest` | Digest of usage rows included in the batch |
|
|
291
|
+
| `provider_receivable_minor` | Provider amount for the batch |
|
|
292
|
+
| `settled_provider_receivable_minor` | Provider amount that is settled on-chain |
|
|
293
|
+
| `unsettled_provider_receivable_minor` | Provider amount not yet settled |
|
|
294
|
+
| `past_due_provider_receivable_minor` | Provider amount blocked on past-due settlement |
|
|
295
|
+
| `gross_buyer_debit_minor` | Provider amount plus protocol fee |
|
|
296
|
+
| `protocol_fee_minor` | Micro / Nano protocol fee |
|
|
297
|
+
| `buyer_debit_minor` | Amount scheduled for the buyer debit |
|
|
298
|
+
| `attempt_count`, `next_attempt_at` | Retry state |
|
|
299
|
+
| `failure_reason_code`, `failure_reason_label`, `failure_reason_help` | Sanitized public failure reason |
|
|
300
|
+
| `support_reference` | Non-secret support reference |
|
|
301
|
+
|
|
302
|
+
Provider APIs do not expose relayer IDs, nonce values, gas data, raw RPC errors,
|
|
303
|
+
raw `failure_message`, buyer email, buyer wallet address, or raw `buyer_user_id`.
|
|
304
|
+
|
|
305
|
+
### CSV Export
|
|
306
|
+
|
|
307
|
+
```bash
|
|
308
|
+
curl https://siglume.com/v1/sdrp/metered/provider/settlement-batches/<batch-id>/usage-events.csv \
|
|
309
|
+
-H "Authorization: Bearer <provider-siglume-bearer-token>" \
|
|
310
|
+
-o sdrp-metered.csv
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
The CSV contains exactly these columns:
|
|
314
|
+
|
|
315
|
+
```text
|
|
316
|
+
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
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
The CSV uses `buyer_period_ref`, not `buyer_user_id`.
|
|
320
|
+
|
|
321
|
+
## Notifications
|
|
322
|
+
|
|
323
|
+
Siglume sends platform notifications for Micro / Nano settlement state. Your
|
|
324
|
+
integration should not send a buyer debit notice as if it were the source of
|
|
325
|
+
truth.
|
|
326
|
+
|
|
327
|
+
Buyer-facing notifications:
|
|
328
|
+
|
|
329
|
+
- estimate before close when there is chargeable usage in the period,
|
|
330
|
+
- final debit scheduled after period close,
|
|
331
|
+
- settlement failed / retry scheduled when the buyer can fix balance,
|
|
332
|
+
allowance, BudgetVault, or caps,
|
|
333
|
+
- settlement past due after automatic attempts are exhausted.
|
|
334
|
+
|
|
335
|
+
Provider-facing notifications:
|
|
336
|
+
|
|
337
|
+
- period summary / expected settlement,
|
|
338
|
+
- settlement succeeded,
|
|
339
|
+
- settlement failed / retry scheduled,
|
|
340
|
+
- settlement past due.
|
|
341
|
+
|
|
342
|
+
There is no provider "final debit" notice. Providers should use statement APIs
|
|
343
|
+
for expected and settled revenue. Standard `direct_payment.confirmed` webhooks
|
|
344
|
+
remain the source for immediate Standard Payment fulfillment, but they are not a
|
|
345
|
+
complete revenue statement for Micro / Nano aggregated settlement.
|
|
346
|
+
|
|
347
|
+
## Failure and Retry Policy
|
|
348
|
+
|
|
349
|
+
Siglume retries failed Micro / Nano settlement every 6 hours for up to 28
|
|
350
|
+
automatic attempts. After that the batch remains `past_due` until operator
|
|
351
|
+
requeue.
|
|
352
|
+
|
|
353
|
+
New Micro / Nano usage for the same buyer, plan type, and token is paused while
|
|
354
|
+
the past-due block remains. The provider API is not called for the rejected
|
|
355
|
+
request, and the request is not charged.
|
|
356
|
+
|
|
357
|
+
Public failure fields are sanitized. Show `failure_reason_code`,
|
|
358
|
+
`failure_reason_label`, `failure_reason_help`, and `support_reference` to users
|
|
359
|
+
or support staff. Do not depend on raw platform failure messages.
|
|
360
|
+
|
|
361
|
+
## Usage Accounting by Result
|
|
362
|
+
|
|
363
|
+
Use idempotency keys for every paid operation. Siglume records one chargeable
|
|
364
|
+
usage event per idempotency key within the same buyer / listing / operation
|
|
365
|
+
scope.
|
|
366
|
+
|
|
367
|
+
| Case | Provider API executed? | Usage counted? | Integration rule |
|
|
368
|
+
| --- | --- | --- | --- |
|
|
369
|
+
| Budget gate rejected | No | No | Treat the request as rejected with no charge. The provider must not fulfill work. |
|
|
370
|
+
| Provider returns 2xx | Yes | Yes | Chargeable usage is recorded once. Fulfill idempotently by order id / requirement id / idempotency key. |
|
|
371
|
+
| Provider returns 4xx | Yes | Usually no, unless your integration deliberately marks the work as accepted before returning the 4xx | Prefer returning 2xx for completed work and 4xx only for unfulfilled client errors. Document any deliberate `failed_chargeable` mapping in your provider. |
|
|
372
|
+
| Provider returns 5xx | Yes | No by default | Treat as unfulfilled; retry from the caller with the same idempotency key if safe. |
|
|
373
|
+
| Provider timeout | Unknown | No by default unless the provider later confirms successful work under the same idempotency key | Reconcile by idempotency key before retrying side effects. |
|
|
374
|
+
| Client disconnects after provider success | Yes | Yes if the provider completed work and Siglume observed/records that success | The client may see failure while the provider completed work; use idempotency to avoid duplicate fulfillment. |
|
|
375
|
+
| Duplicate idempotency key | Maybe | One usage event | Return/reconcile the first outcome; do not create another chargeable event. |
|
|
376
|
+
| Usage cancellation/refund before settlement | Depends on platform support and status | Not self-service in this SDK release | Contact support or use the platform path Siglume provides for the account; do not mutate CSV/statement totals locally. |
|
|
377
|
+
| Refund/adjustment after settlement | Settled on-chain | Not self-service in this SDK release | Handle through an explicit adjustment/refund process; do not reverse settled revenue by editing statements. |
|
|
378
|
+
|
|
379
|
+
`failed_chargeable` means the provider-side work is treated as completed or
|
|
380
|
+
economically accepted even though the caller may have observed a failure state.
|
|
381
|
+
It is for cases such as "provider completed the operation, but the client
|
|
382
|
+
connection failed before receiving the response." It is not a catch-all for
|
|
383
|
+
provider 5xx errors. Integrations should make this state rare and defensible by
|
|
384
|
+
using stable idempotency keys and provider-side completion records.
|
|
385
|
+
|
|
386
|
+
## Operational Status Handling
|
|
387
|
+
|
|
388
|
+
| Status | Buyer / provider view | Automatic processing | Operator action | Integration guidance |
|
|
389
|
+
| --- | --- | --- | --- | --- |
|
|
390
|
+
| `notice_delivery_failed` | Buyer debit is not yet allowed; provider revenue remains unsettled | Notice delivery can be retried or reviewed | Required if delivery keeps failing | Do not attempt your own debit notice or mark revenue settled. Show support context only. |
|
|
391
|
+
| `submitted_reconcile_required` | A settlement submission exists but final on-chain outcome is not yet reconciled | Reconciliation may complete if a receipt is found | Required if reconciliation stalls | Do not retry payment yourself. Wait for `settled`, `failed_retryable`, or `past_due`. |
|
|
392
|
+
| `past_due` | Buyer has an unresolved settlement block; provider sees past-due revenue | New Micro / Nano usage for the same buyer / plan / token is paused | Operator requeue or manual resolution only | Do not promise collection or provider payment. Ask the buyer to repair balance / allowance / BudgetVault / caps and reference `support_reference`. |
|
|
393
|
+
| `failed_chargeable` | Usage is still chargeable because provider work was accepted or completed | Included in later settlement attempts | Review if the provider disputes completion | Keep fulfillment idempotent and preserve evidence keyed by idempotency key. |
|
|
394
|
+
|
|
395
|
+
## Operational Recipes
|
|
396
|
+
|
|
397
|
+
### "How much did we use this week or month?"
|
|
398
|
+
|
|
399
|
+
Call provider summary and read:
|
|
400
|
+
|
|
401
|
+
- `open_periods` for usage in the currently open period,
|
|
402
|
+
- `periods` for closed or settled periods,
|
|
403
|
+
- `provider_receivable_minor` on each period,
|
|
404
|
+
- CSV export for line-level reconciliation.
|
|
405
|
+
|
|
406
|
+
### "When will we be paid?"
|
|
407
|
+
|
|
408
|
+
For open periods, read `expected_scheduled_debit_at`. After a batch exists, read
|
|
409
|
+
`scheduled_debit_at` and `not_before_attempt_at`. Actual provider revenue is
|
|
410
|
+
settled only when `status === "settled"` and `chain_receipt_id` is present.
|
|
411
|
+
|
|
412
|
+
### "Why did new Micro / Nano usage stop?"
|
|
413
|
+
|
|
414
|
+
Buyer summary `past_due_blocks` returns `METERED_SETTLEMENT_PAST_DUE` with a
|
|
415
|
+
sanitized reason and support reference. The buyer must repair the listed balance
|
|
416
|
+
or authorization issue. Requeue is operator-only in the MVP.
|
|
417
|
+
|
|
418
|
+
### "What should our accounting system book?"
|
|
419
|
+
|
|
420
|
+
Book `settled_provider_receivable_minor` as settled revenue. Keep
|
|
421
|
+
`unsettled_provider_receivable_minor` and `past_due_provider_receivable_minor`
|
|
422
|
+
separate from settled revenue.
|
|
423
|
+
|
|
424
|
+
## Go-Live Checklist
|
|
425
|
+
|
|
426
|
+
- Your order fulfillment is idempotent by order id and requirement id.
|
|
427
|
+
- Standard Payment fulfillment still uses verified `direct_payment.confirmed`.
|
|
428
|
+
- Micro / Nano accounting uses statement APIs or CSV, not only webhooks.
|
|
429
|
+
- Your dashboard separates settled, unsettled, and past-due provider amounts.
|
|
430
|
+
- Your support UI shows sanitized failure fields and `support_reference`.
|
|
431
|
+
- You do not store or display raw buyer IDs from provider APIs; use
|
|
432
|
+
`buyer_period_ref`.
|
|
433
|
+
- You do not recognize Micro / Nano provider revenue before on-chain settlement.
|
package/docs/pricing.md
CHANGED
|
@@ -26,14 +26,25 @@ quoted per currency.
|
|
|
26
26
|
|
|
27
27
|
| Payment amount | Applied automatically | What you select | Fee | Settlement |
|
|
28
28
|
| --- | --- | --- | --- | --- |
|
|
29
|
-
| Over JPY 500 / over USD 3.00
|
|
30
|
-
| JPY 50-500 /
|
|
31
|
-
| Under JPY
|
|
29
|
+
| Over JPY 500 / over USD 3.00 | 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 / 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
|
|
35
|
-
[Settlement schedule](#settlement-schedule) for
|
|
36
|
-
when revenue becomes settled, and how rejected
|
|
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 window elapses, when revenue becomes settled, and how rejected
|
|
37
|
+
requests behave.
|
|
38
|
+
|
|
39
|
+
The current public API chooses the band from `amount_minor`; it does not expose
|
|
40
|
+
`settlement_mode: "immediate"` or `require_immediate_finality: true`. If a
|
|
41
|
+
merchant needs immediate on-chain finality, the payment amount must be in the
|
|
42
|
+
Standard band or the merchant must have a separately agreed platform contract.
|
|
43
|
+
|
|
44
|
+
For the operational statement APIs, CSV export, buyer past-due blocks, and the
|
|
45
|
+
field-by-field meaning of `scheduled_debit_at`, `not_before_attempt_at`,
|
|
46
|
+
`execution_status`, and `buyer_period_ref`, see
|
|
47
|
+
[Micro / Nano Statements and Notices](./metered-statements.md).
|
|
37
48
|
|
|
38
49
|
USD pricing is the JPY tier converted at roughly 160 JPY/USD and rounded to
|
|
39
50
|
clean price points that keep the same 1:3:10 tier ratio.
|
|
@@ -46,10 +57,13 @@ Per-payment fees are deducted at settlement, so the merchant receives the net
|
|
|
46
57
|
amount for each payment. Monthly base fees are collected separately through the
|
|
47
58
|
merchant billing mandate.
|
|
48
59
|
|
|
49
|
-
The same
|
|
50
|
-
`fee_bps` in the merchant's
|
|
51
|
-
|
|
52
|
-
value Siglume returns.
|
|
60
|
+
The same Standard Payment percentage schedule applies in JPY and USD. For
|
|
61
|
+
Standard Payment, the Siglume platform returns `fee_bps` in the merchant's
|
|
62
|
+
settlement currency on the payment requirement, so the SDK never has to know
|
|
63
|
+
which currency table to read — it just trusts the value Siglume returns. For
|
|
64
|
+
Micro / Nano, the authoritative fee fields are the statement API amounts:
|
|
65
|
+
`protocol_fee_minor`, `gross_buyer_debit_minor`, `buyer_debit_minor`, and
|
|
66
|
+
`rounding_delta_minor`.
|
|
53
67
|
|
|
54
68
|
## Settlement schedule
|
|
55
69
|
|
|
@@ -59,8 +73,8 @@ confirmed payment turns into money in your settlement wallet.
|
|
|
59
73
|
| Band | Cadence | Period | You are paid |
|
|
60
74
|
| --- | --- | --- | --- |
|
|
61
75
|
| Standard Payment | Per payment | n/a | On-chain, immediately after each payment confirms |
|
|
62
|
-
| Micro Payment | Weekly |
|
|
63
|
-
| Nano Payment | Monthly |
|
|
76
|
+
| 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 window has elapsed, in aggregated on-chain settlement(s) grouped per buyer, payee, token, and period |
|
|
77
|
+
| 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 window has elapsed, in aggregated on-chain settlement(s) grouped per buyer, payee, token, and period |
|
|
64
78
|
|
|
65
79
|
### Micro weekly settlement
|
|
66
80
|
|
|
@@ -74,7 +88,7 @@ confirmed payment turns into money in your settlement wallet.
|
|
|
74
88
|
payments — grouped per buyer, payee, token, and period — into on-chain
|
|
75
89
|
settlement(s). Siglume sends the final debit notice first; the on-chain debit
|
|
76
90
|
is not attempted until the scheduled attempt time after an approximately
|
|
77
|
-
3-day pre-debit notice
|
|
91
|
+
3-day pre-debit notice window (`not_before_attempt_at`).
|
|
78
92
|
- **Revenue recognition.** A Micro payment is final only once its weekly
|
|
79
93
|
settlement confirms on-chain. Until then it is accrued, not settled.
|
|
80
94
|
|
|
@@ -90,7 +104,7 @@ confirmed payment turns into money in your settlement wallet.
|
|
|
90
104
|
payments — grouped per buyer, payee, token, and period — into on-chain
|
|
91
105
|
settlement(s). Siglume sends the final debit notice first; the on-chain debit
|
|
92
106
|
is not attempted until the scheduled attempt time after an approximately
|
|
93
|
-
3-day pre-debit notice
|
|
107
|
+
3-day pre-debit notice window (`not_before_attempt_at`).
|
|
94
108
|
- **Revenue recognition.** A Nano payment is final only once its monthly
|
|
95
109
|
settlement confirms on-chain.
|
|
96
110
|
|
|
@@ -109,38 +123,83 @@ confirmed payment turns into money in your settlement wallet.
|
|
|
109
123
|
- Outstanding amounts remain attached to the failed settlement and are retried
|
|
110
124
|
under this policy. They are not settled revenue, and Siglume does not advance,
|
|
111
125
|
guarantee, or insure provider revenue before on-chain settlement succeeds.
|
|
126
|
+
- A `past_due` batch remains recorded until operator resolution or requeue, but
|
|
127
|
+
this does not guarantee collection from the buyer or payment to the provider.
|
|
112
128
|
|
|
113
129
|
### Rejected / no-charge behavior
|
|
114
130
|
|
|
115
131
|
Micro and Nano run a budget check before the buyer's paid request is fulfilled:
|
|
116
132
|
|
|
117
|
-
- A buyer's wallet budget is consumed at the **gross amount** (your
|
|
118
|
-
the protocol fee)
|
|
119
|
-
|
|
133
|
+
- A buyer's wallet budget reservation is consumed at the **gross amount** (your
|
|
134
|
+
price plus the protocol fee) from acceptance until settlement confirms. This
|
|
135
|
+
is a reservation against Siglume spending limits; it does not lock, escrow,
|
|
136
|
+
preserve, or guarantee the buyer's token balance, allowance, BudgetVault
|
|
137
|
+
authorization, or payment source.
|
|
120
138
|
- If the buyer's budget, scope, or amount band does not allow a request, it is
|
|
121
139
|
**rejected with no charge**: the request is not fulfilled, no amount is
|
|
122
140
|
accrued, and nothing is added to a settlement. A buyer near their budget
|
|
123
141
|
ceiling can have a request rejected even though earlier requests in the same
|
|
124
142
|
period succeeded.
|
|
125
|
-
- Treat Siglume's
|
|
126
|
-
|
|
143
|
+
- Treat Siglume's statement status, `settled_at`, and `chain_receipt_id` as the
|
|
144
|
+
source of truth for Micro / Nano provider revenue. Webhooks are still required
|
|
145
|
+
for fulfillment, but they are not the complete Micro / Nano settlement ledger.
|
|
127
146
|
|
|
128
147
|
### What is fixed vs platform-managed
|
|
129
148
|
|
|
130
149
|
The cadence is fixed: **Micro settles weekly, Nano settles monthly**, and a
|
|
131
|
-
payment is final only after its on-chain settlement confirms.
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
`
|
|
150
|
+
payment is final only after its on-chain settlement confirms. Micro and Nano are
|
|
151
|
+
automatic amount bands, not customer-selected options. The account-assigned
|
|
152
|
+
period boundaries, roughly 3-day pre-debit notice window, and current retry policy
|
|
153
|
+
above are the public behavior as of 2026-06-18. Treat the platform's statement
|
|
154
|
+
status, `not_before_attempt_at`, Standard `fee_bps`, and Micro / Nano statement
|
|
155
|
+
amount fields as authoritative rather than hard-coding local revenue
|
|
136
156
|
recognition.
|
|
137
157
|
|
|
158
|
+
## Micro / Nano Amount Rounding
|
|
159
|
+
|
|
160
|
+
Micro / Nano fees are stored internally as decimal minor-unit values so
|
|
161
|
+
sub-yen and sub-cent Nano fees are not silently rounded per usage event. The
|
|
162
|
+
current settlement rule is:
|
|
163
|
+
|
|
164
|
+
```text
|
|
165
|
+
provider_usage_amount_minor = sum(provider price minor units for accepted usage)
|
|
166
|
+
protocol_fee_minor = sum(Micro/Nano fixed protocol fee minor units for accepted usage)
|
|
167
|
+
gross_buyer_debit_minor = provider_usage_amount_minor + protocol_fee_minor
|
|
168
|
+
buyer_debit_minor = ceil(gross_buyer_debit_minor)
|
|
169
|
+
rounding_delta_minor = buyer_debit_minor - gross_buyer_debit_minor
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Rounding happens once when the settlement batch is created, not per usage event.
|
|
173
|
+
The rounding mode is ceiling to the next integer token minor unit because
|
|
174
|
+
on-chain settlement cannot debit fractional JPYC/USDC minor units. The positive
|
|
175
|
+
`rounding_delta_minor` is part of the buyer debit for that batch and is retained
|
|
176
|
+
as a rounding adjustment in Siglume's settlement accounting; it is not provider
|
|
177
|
+
revenue. Providers should reconcile their revenue with
|
|
178
|
+
`provider_receivable_minor`, `settled_provider_receivable_minor`,
|
|
179
|
+
`unsettled_provider_receivable_minor`, and
|
|
180
|
+
`past_due_provider_receivable_minor`, not with `buyer_debit_minor`.
|
|
181
|
+
|
|
182
|
+
## Statement APIs and Notices
|
|
183
|
+
|
|
184
|
+
Micro and Nano require operational reconciliation after usage is accepted. The
|
|
185
|
+
payment requirement response tells you the immediate payment requirement state,
|
|
186
|
+
but it does not replace the Micro / Nano statement APIs.
|
|
187
|
+
|
|
188
|
+
Use [Micro / Nano Statements and Notices](./metered-statements.md) to integrate:
|
|
189
|
+
|
|
190
|
+
- provider summary of open, settled, unsettled, and past-due revenue,
|
|
191
|
+
- provider usage-event CSV export,
|
|
192
|
+
- buyer summaries for open-period estimated debit and past-due blocks,
|
|
193
|
+
- sanitized public failure reasons and support references,
|
|
194
|
+
- the fixed final notice plus close-plus-3-day debit window.
|
|
195
|
+
|
|
138
196
|
## SDK Behavior
|
|
139
197
|
|
|
140
198
|
The SDK does not calculate merchant invoices or enforce plan limits locally.
|
|
141
199
|
Instead, it exposes billing-related values returned by Siglume, including
|
|
142
|
-
`fee_bps` on a payment requirement
|
|
143
|
-
|
|
200
|
+
Standard Payment `fee_bps` on a payment requirement and Micro / Nano statement
|
|
201
|
+
amount fields. This keeps merchant billing centralized in the Siglume platform
|
|
202
|
+
and avoids stale client-side pricing logic.
|
|
144
203
|
|
|
145
204
|
## Supported Use Cases
|
|
146
205
|
|
|
@@ -158,4 +217,5 @@ The Siglume API and merchant registry may still expose the legacy `billing_plan`
|
|
|
158
217
|
value `free` for the Launch tier. Treat `free` as a wire-compatibility key, not a
|
|
159
218
|
public plan name. (Until 2026-06-12 the Launch plan included a free monthly
|
|
160
219
|
allowance of 100 payments; that allowance has been retired — the platform
|
|
161
|
-
`fee_bps` response
|
|
220
|
+
Standard `fee_bps` response and Micro / Nano statement amount fields are always
|
|
221
|
+
the source of truth.)
|