diff --git a/examples/v1.1.0/commercial/purchase/invalid/900-purchase.receipt.invalid.json b/examples/v1.1.0/commercial/purchase/invalid/900-purchase.receipt.invalid.json index 35d7165..90a7c1a 100644 --- a/examples/v1.1.0/commercial/purchase/invalid/900-purchase.receipt.invalid.json +++ b/examples/v1.1.0/commercial/purchase/invalid/900-purchase.receipt.invalid.json @@ -5,7 +5,7 @@ "receipt_id": "bad-purchasercpt-001", "issued_at": "2026-03-19T10:10:02Z", "request_id": "purchasereq-001", - "status": "rejected", + "status": "captured", "purchase_id": "purchase-001", "payer": { "role": "payer", diff --git a/examples/v1.1.0/commercial/purchase/valid/900-purchase.receipt.valid.json b/examples/v1.1.0/commercial/purchase/valid/900-purchase.receipt.valid.json index c65c1d0..5d1de7e 100644 --- a/examples/v1.1.0/commercial/purchase/valid/900-purchase.receipt.valid.json +++ b/examples/v1.1.0/commercial/purchase/valid/900-purchase.receipt.valid.json @@ -5,7 +5,7 @@ "receipt_id": "purchasercpt-001", "issued_at": "2026-03-19T10:10:02Z", "request_id": "purchasereq-001", - "status": "accepted", + "status": "captured", "purchase_id": "purchase-001", "payer": { "role": "payer", @@ -49,5 +49,11 @@ "payment_ref": { "type": "payment", "id": "pay-2001" + }, + "payment_proof": { + "scheme": "x402", + "proof_type": "payment-proof", + "proof_ref": "proof-2001", + "uri": "urn:cl:x402:proof:proof-2001" } } diff --git a/schemas/v1.1.0/commercial/purchase/purchase.receipt.schema.json b/schemas/v1.1.0/commercial/purchase/purchase.receipt.schema.json index d351a0e..0371c41 100644 --- a/schemas/v1.1.0/commercial/purchase/purchase.receipt.schema.json +++ b/schemas/v1.1.0/commercial/purchase/purchase.receipt.schema.json @@ -169,6 +169,38 @@ "$ref": "#/$defs/money" } } + }, + "x402_proof": { + "type": "object", + "additionalProperties": false, + "required": [ + "scheme", + "proof_type", + "proof_ref" + ], + "properties": { + "scheme": { + "type": "string", + "const": "x402" + }, + "proof_type": { + "type": "string", + "enum": [ + "payment-session", + "payment-proof" + ] + }, + "proof_ref": { + "type": "string", + "minLength": 1, + "maxLength": 128 + }, + "uri": { + "type": "string", + "format": "uri", + "maxLength": 512 + } + } } }, "properties": { @@ -201,8 +233,8 @@ "status": { "type": "string", "enum": [ - "accepted", - "rejected", + "captured", + "failed", "pending" ] }, @@ -235,6 +267,9 @@ "payment_ref": { "$ref": "#/$defs/reference" }, + "payment_proof": { + "$ref": "#/$defs/x402_proof" + }, "reason": { "type": "string", "maxLength": 512 @@ -255,12 +290,31 @@ "settlement" ], "allOf": [ + { + "if": { + "properties": { + "status": { + "const": "captured" + } + } + }, + "then": { + "properties": { + "payment_proof": { + "$ref": "#/$defs/x402_proof" + } + }, + "required": [ + "payment_proof" + ] + } + }, { "if": { "properties": { "status": { "enum": [ - "rejected", + "failed", "pending" ] }