Skip to content

Commit 02a9606

Browse files
authored
Tighten commercial actor and payment grammar (#9)
1 parent e7d4ce4 commit 02a9606

28 files changed

+2192
-511
lines changed

POLICY.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,10 @@ Release-defining prose docs may govern interpretation and process, but they are
2424

2525
- Schema fixes before publication require maintainer signoff.
2626
- New verbs or version lines require explicit steward approval.
27+
28+
## Commercial language governance
29+
30+
- Actor roles are governed repo-wide; new roles require explicit steward approval.
31+
- `payment_requirement`, `payment_session`, and `payment_proof` are the canonical payment-layer names for shared semantics.
32+
- `fulfillment_ref` denotes the merchant or provider controlled fulfillment artifact, not a generic external pointer.
33+
- Shipment receipts must remain commercially scoped and tied to an upstream checkout or purchase.

README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,45 @@ Protocol-Commercial is x402-first.
3535

3636
That means the normative commercial assumption is that commercial execution is gated and proven through x402-compatible payment requirements, sessions, authorizations, and proofs. The schemas in this repository do not define a transport implementation, but they do make the commercial contract explicit enough for an x402-aware runtime to execute deterministically.
3737

38+
## Commercial grammar decisions
39+
40+
### Actor grammar
41+
42+
Protocol-Commercial uses a compact actor model:
43+
44+
- `payer`: the party funding or bearing the commercial obligation
45+
- `payee`: the settlement recipient when it differs from the merchant identity
46+
- `merchant`: the seller or commercial principal governing the offer, order, or fulfillment
47+
- `provider`: an optional facilitating runtime or service performing settlement or fulfillment work on the merchant
48+
- `carrier`: the shipment operator once physical fulfillment exists
49+
- `verifier`: an authority that validates commercial evidence
50+
51+
Field names are normative. A `merchant` field MUST carry a `merchant` actor, a `payer` field MUST carry a `payer` actor, and so on. `payee` is used only for settlement destination semantics; if omitted, the merchant is implicitly the payee.
52+
53+
### x402 / payment grammar
54+
55+
Protocol-Commercial standardizes three payment layers across the verb family:
56+
57+
- `payment_requirement`: pre-payment terms or authorization preconditions
58+
- `payment_session`: live x402 negotiation/session state
59+
- `payment_proof`: final payment evidence for authorization or captured settlement
60+
61+
The verbs use those layers intentionally:
62+
63+
- `authorize` centers on `payment_requirement` and may emit authorization-flavored `payment_proof`
64+
- `checkout` centers on `payment_session` and requires `payment_proof` when capture succeeds
65+
- `purchase` accepts direct `payment_input` and requires `payment_proof` when capture succeeds
66+
- `ship` links to upstream commercial settlement through `commercial_ref` and optional `payment_ref`, rather than restating the full payment flow
67+
- `verify` verifies `payment_proof`, settlement, fulfillment, and receipt evidence
68+
3869
## Verb set
3970

4071
| Verb | Purpose |
4172
| --- | --- |
4273
| `authorize` | Reserve payment authority before capture or settlement |
4374
| `checkout` | Finalize an order and request commercial capture |
4475
| `purchase` | Complete a one-step paid commercial action |
45-
| `ship` | Attach fulfillment state to a commercial order or purchase |
76+
| `ship` | Advance commercial fulfillment state for a settled checkout or purchase |
4677
| `verify` | Verify a commercial receipt, settlement, payment, or shipment target |
4778

4879
## Repository layout
@@ -127,6 +158,7 @@ This repository does not define:
127158
"total": { "amount": "49.99", "currency": "USDC", "decimals": 2 }
128159
},
129160
"capture": "immediate",
161+
"payee": { "role": "payee", "id": "merchant-settlement", "kind": "wallet" },
130162
"payment_session": {
131163
"scheme": "x402",
132164
"session_id": "x402-session-001",

SPEC.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,33 @@ Commercial schemas SHOULD add stricter structure than Commons wherever value mov
6565

6666
- explicit counterparties
6767
- typed monetary amounts
68-
- typed references to order, invoice, authorization, payment, settlement, or shipment artifacts
68+
- typed references to order, invoice, authorization, fulfillment, payment, settlement, or shipment artifacts
6969
- typed settlement status
7070
- typed verification outcomes
7171

72+
### 5.1 Actor grammar
73+
74+
Protocol-Commercial v1.1.0 uses a compact governed actor grammar:
75+
76+
- `payer` = the party that funds or bears the payment obligation
77+
- `payee` = the settlement recipient when distinct from the merchant
78+
- `merchant` = the commercial principal offering, selling, or fulfilling the order
79+
- `provider` = an optional facilitator executing settlement or fulfillment work for the merchant
80+
- `carrier` = the shipment operator for physical fulfillment
81+
- `verifier` = the authority validating commercial evidence
82+
83+
Actor field names are normative. A field named `merchant` MUST contain an actor whose role is `merchant`, and likewise for the other actor fields.
84+
85+
### 5.2 Payment grammar
86+
87+
Protocol-Commercial v1.1.0 uses one payment language across the family:
88+
89+
- `payment_requirement` = pre-payment terms or authorization preconditions
90+
- `payment_session` = live x402 negotiation/session state
91+
- `payment_proof` = final authorization or settlement evidence
92+
93+
Requests SHOULD carry the earliest payment layer the caller can truthfully provide. Receipts MUST carry the latest payment layer the verb has canonically established. Successful capture receipts for `checkout` and `purchase` MUST carry `payment_proof`. `ship` MUST link to the upstream commercial transaction and MAY carry payment evidence by reference rather than re-embedding settlement state.
94+
7295
## 6. x402 binding expectations
7396

7497
Protocol-Commercial v1.1.0 is x402-first.

checksums.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
a63b196cdd5d050dcd12c7a01f15757ad1558afae8b7c81681e50da23149df44 examples/v1.1.0/commercial/authorize/invalid/001-authorize.request.invalid.json
22
8b577f94216c6674dc7781a692715ccd814b253fa74fa807b695e8ea5c144748 examples/v1.1.0/commercial/authorize/invalid/900-authorize.receipt.invalid.json
33
afbcee85906d0249ed0c60eecf40657832549ca8032a99154dd0e643b6d82884 examples/v1.1.0/commercial/authorize/valid/001-authorize.request.valid.json
4-
477d5b42eca56782145d60b167934fe6c038e0bdb9ed62b608987352ccb5229d examples/v1.1.0/commercial/authorize/valid/900-authorize.receipt.valid.json
4+
c0ca42d7269f82c69cdcb24a0cd19d9bfc0a30cbf9b991e3f82b58c01ac16961 examples/v1.1.0/commercial/authorize/valid/900-authorize.receipt.valid.json
55
4c3fe6aff5283da7b083e072d8f5a3c9362fbbf1a9614322a297a350cbfbea8d examples/v1.1.0/commercial/checkout/invalid/001-checkout.request.invalid.json
66
c87c1e944610020925d0ad5f78d9f5c3532c53494b824dca014537859f6ebed0 examples/v1.1.0/commercial/checkout/invalid/900-checkout.receipt.invalid.json
7-
ed17f81adaf17f338e56157f2b3ee54831d5eeb03f08c4da8ba5a088a4f6c587 examples/v1.1.0/commercial/checkout/valid/001-checkout.request.valid.json
8-
9341c26828d9d4f5ea15597a406face97b424f18a9a919dcac37b92b7bedb31f examples/v1.1.0/commercial/checkout/valid/900-checkout.receipt.valid.json
9-
9ef6537f316094ede495337b869e85bd7231dc1dc62c12018ad193c81101bb0e examples/v1.1.0/commercial/purchase/invalid/001-purchase.request.invalid.json
10-
02445b05f1baaff11508c7ea66e9fc83f46e348d8aa0d3dddd3a3a49673350cf examples/v1.1.0/commercial/purchase/invalid/900-purchase.receipt.invalid.json
11-
db9b72f90c2cd85f43052b877a798e16023bce78c62a76c5ce004d0ea4ed11a6 examples/v1.1.0/commercial/purchase/valid/001-purchase.request.valid.json
12-
f6c68d52cfb7aff498ba4425a0e304806adf0d51fd0df74963184d978d598cec examples/v1.1.0/commercial/purchase/valid/900-purchase.receipt.valid.json
13-
bdd3b549b13629af35cacc4a7a3a290de43a3218143e65918c9e38d8521ddbda examples/v1.1.0/commercial/ship/invalid/001-ship.request.invalid.json
14-
3be92029cf79f92d299b995610073d0149c16e047165369533f5e660120bf621 examples/v1.1.0/commercial/ship/invalid/900-ship.receipt.invalid.json
15-
f70e948f963cf243b9d9a26e671bfee9941ec65f829bb900751e0436691f69de examples/v1.1.0/commercial/ship/valid/001-ship.request.valid.json
16-
cef000ad2e5b6952ad9b31bb1b068a6e457a22ee3e3b21d1683bd92936d06ab0 examples/v1.1.0/commercial/ship/valid/900-ship.receipt.valid.json
7+
6607a0a6ceefd0ca978f7969cb1e6e326e9a8ceaedde17505d2be81a260b3c8c examples/v1.1.0/commercial/checkout/valid/001-checkout.request.valid.json
8+
f8880c06f91c1d21a617fbe7f2b6a9d41d37db9f4fd5e9998689100c16f4000e examples/v1.1.0/commercial/checkout/valid/900-checkout.receipt.valid.json
9+
b21abc778134f0cd712027b093b2e6fb213866fa399e5756c6bad9b7b68eba11 examples/v1.1.0/commercial/purchase/invalid/001-purchase.request.invalid.json
10+
1222a815c6cff7cfce737dd7b99c488d167055f8ee061cda191b631d546b62c6 examples/v1.1.0/commercial/purchase/invalid/900-purchase.receipt.invalid.json
11+
2b235a6d567127c54da9c6c3eacf915c79a5c5127197a9aadbfb50289b122957 examples/v1.1.0/commercial/purchase/valid/001-purchase.request.valid.json
12+
ec905c885a47aba6cf336666fc322bc40a45ab52647ca722965cafd1b0e5f55a examples/v1.1.0/commercial/purchase/valid/900-purchase.receipt.valid.json
13+
a10046d83c5455867a21f7d6fc30dea3241a40f64a90c53b3d5fbc2d3bdff549 examples/v1.1.0/commercial/ship/invalid/001-ship.request.invalid.json
14+
6fbf8480ce1dc706be1d8efe33f4c9542c188b45f5a9ca18c38b74996d085c79 examples/v1.1.0/commercial/ship/invalid/900-ship.receipt.invalid.json
15+
576924f554079213ce078d4be6c54e5ffc58839bde4182d73d02ba3412e47f3b examples/v1.1.0/commercial/ship/valid/001-ship.request.valid.json
16+
a004cb1385b1ca173b89df702e2b52d63f870521652f98f023359d30009b8df0 examples/v1.1.0/commercial/ship/valid/900-ship.receipt.valid.json
1717
b9bcdbcd34058ab229df851448925370a586e2bbedc77a8e28b535e1a9468c6e examples/v1.1.0/commercial/verify/invalid/001-verify.request.invalid.json
18-
51fcf4b17443a780851dc563dd867d155d334d83cd44a44146197e270c1caae9 examples/v1.1.0/commercial/verify/invalid/900-verify.receipt.invalid.json
18+
e0016f3510bda6efcbdc3984bd077c37160a6a9db039dafa1d602806d8cf6e73 examples/v1.1.0/commercial/verify/invalid/900-verify.receipt.invalid.json
1919
56d02915471d62f7687e3f6258d75754c8e7a44ca717e4ca0906dd4bb6fc34fb examples/v1.1.0/commercial/verify/valid/001-verify.request.valid.json
2020
440c964d06f48470e17110a4cd683085740cae97e937a2452c0e4d4eec2b8bb4 examples/v1.1.0/commercial/verify/valid/900-verify.receipt.valid.json
2121
dffbf20c692d46a3a8af047a2fa4647c33ec910e76c30dd5f948eac258668556 manifest.json

examples/v1.1.0/commercial/authorize/valid/900-authorize.receipt.valid.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,18 @@
1717
"id": "merchant-settlement",
1818
"kind": "wallet"
1919
},
20+
"merchant": {
21+
"role": "merchant",
22+
"id": "merchant.example",
23+
"kind": "organization"
24+
},
2025
"amount": {
2126
"amount": "49.99",
2227
"currency": "USDC",
2328
"decimals": 2
2429
},
2530
"approved_until": "2026-03-20T10:00:00Z",
26-
"settlement_precondition_ref": {
31+
"payment_requirement_ref": {
2732
"type": "payment_requirement",
2833
"id": "x402-auth-001"
2934
},

examples/v1.1.0/commercial/checkout/valid/001-checkout.request.valid.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
"id": "merchant.example",
1515
"kind": "organization"
1616
},
17+
"payee": {
18+
"role": "payee",
19+
"id": "merchant-settlement",
20+
"kind": "wallet"
21+
},
1722
"provider": {
1823
"role": "provider",
1924
"id": "runtime.commandlayer",

examples/v1.1.0/commercial/checkout/valid/900-checkout.receipt.valid.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
"id": "merchant.example",
1717
"kind": "organization"
1818
},
19+
"payee": {
20+
"role": "payee",
21+
"id": "merchant-settlement",
22+
"kind": "wallet"
23+
},
1924
"order_ref": {
2025
"type": "order",
2126
"id": "ord-1001"
@@ -48,7 +53,7 @@
4853
}
4954
},
5055
"fulfillment_ref": {
51-
"type": "receipt",
56+
"type": "fulfillment",
5257
"id": "fulfill-001",
5358
"uri": "https://merchant.example/fulfillment/fulfill-001"
5459
},

examples/v1.1.0/commercial/purchase/invalid/001-purchase.request.invalid.json

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,26 @@
1212
"role": "merchant",
1313
"id": "merchant.example"
1414
},
15-
"product": {
16-
"product_id": "svc-analysis-pack",
17-
"description": "One analysis execution bundle",
18-
"quantity": 0
15+
"items": [
16+
{
17+
"sku": "svc-analysis-pack",
18+
"description": "One analysis execution bundle",
19+
"quantity": 0,
20+
"unit_price": {
21+
"amount": "12.50",
22+
"currency": "USDC"
23+
}
24+
}
25+
],
26+
"amount_breakdown": {
27+
"subtotal": {
28+
"amount": "12.50",
29+
"currency": "USDC"
30+
},
31+
"total": {
32+
"amount": "12.50",
33+
"currency": "USDC"
34+
}
1935
},
20-
"amount": {
21-
"amount": "12.50",
22-
"currency": "USDC"
23-
},
24-
"x402": {}
36+
"payment_input": {}
2537
}

examples/v1.1.0/commercial/purchase/invalid/900-purchase.receipt.invalid.json

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,22 @@
1515
"role": "merchant",
1616
"id": "merchant.example"
1717
},
18-
"amount": {
19-
"amount": "12.50",
20-
"currency": "USDC"
18+
"amount_breakdown": {
19+
"subtotal": {
20+
"amount": "15.00",
21+
"currency": "USDC"
22+
},
23+
"total": {
24+
"amount": "15.00",
25+
"currency": "USDC"
26+
}
2127
},
2228
"settlement": {
23-
"status": "failed",
29+
"status": "captured",
2430
"method": "x402",
2531
"settlement_ref": "settle-2001",
2632
"amount": {
27-
"amount": "12.50",
33+
"amount": "15.00",
2834
"currency": "USDC"
2935
}
3036
}

examples/v1.1.0/commercial/purchase/valid/001-purchase.request.valid.json

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,49 @@
1414
"id": "merchant.example",
1515
"kind": "organization"
1616
},
17+
"payee": {
18+
"role": "payee",
19+
"id": "merchant-settlement",
20+
"kind": "wallet"
21+
},
1722
"provider": {
1823
"role": "provider",
1924
"id": "runtime.commandlayer",
2025
"kind": "service"
2126
},
22-
"product": {
23-
"product_id": "svc-analysis-pack",
24-
"description": "One analysis execution bundle",
25-
"quantity": 1
26-
},
27-
"amount": {
28-
"amount": "12.50",
29-
"currency": "USDC",
30-
"decimals": 2
27+
"items": [
28+
{
29+
"sku": "svc-analysis-pack",
30+
"description": "One analysis execution bundle",
31+
"quantity": 1,
32+
"unit_price": {
33+
"amount": "12.50",
34+
"currency": "USDC",
35+
"decimals": 2
36+
}
37+
},
38+
{
39+
"sku": "svc-priority-routing",
40+
"description": "Priority routing add-on",
41+
"quantity": 1,
42+
"unit_price": {
43+
"amount": "2.50",
44+
"currency": "USDC",
45+
"decimals": 2
46+
}
47+
}
48+
],
49+
"amount_breakdown": {
50+
"subtotal": {
51+
"amount": "15.00",
52+
"currency": "USDC",
53+
"decimals": 2
54+
},
55+
"total": {
56+
"amount": "15.00",
57+
"currency": "USDC",
58+
"decimals": 2
59+
}
3160
},
3261
"order_ref": {
3362
"type": "order",
@@ -37,7 +66,8 @@
3766
"type": "invoice",
3867
"id": "inv-2001"
3968
},
40-
"x402": {
69+
"merchant_reference": "instant-purchase-2001",
70+
"payment_input": {
4171
"payment_requirement_ref": {
4272
"type": "payment_requirement",
4373
"id": "x402-req-2001"

0 commit comments

Comments
 (0)