Abstract

This specification defines the Digital Receipt Protocol (DRP), a standardized protocol for creating, transmitting, storing, and verifying digital receipts in commercial transactions. DRP provides a secure, privacy-preserving, and interoperable framework for merchants, consumers, payment processors, and third-party applications to exchange receipt data in a machine-readable format.

The protocol addresses the limitations of paper receipts and proprietary digital receipt systems by establishing common data formats, security mechanisms, discovery methods, and verification procedures that work across different vendors and platforms.

Status of This Document

This document is an editor's draft and may be updated, replaced, or obsoleted at any time. It is inappropriate to cite this document as other than work in progress.

1. Introduction

1.1 Motivation

Traditional paper receipts present numerous challenges including environmental waste, consumer inconvenience, difficult expense tracking, and limited machine readability. While various digital receipt solutions exist, they lack interoperability and standardization, creating fragmented ecosystems where consumers must manage multiple apps and merchants must integrate with numerous proprietary systems.

The Digital Receipt Protocol aims to solve these problems by providing:

1.2 Scope

This specification covers:

This specification does not cover:

1.3 Terminology

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119].

Receipt
A digital document that records the details of a commercial transaction.
Merchant
The entity providing goods or services and issuing receipts.
Consumer
The entity purchasing goods or services and receiving receipts.
Receipt Provider
A system that generates and serves digital receipts on behalf of merchants.
Receipt Consumer
An application or service that retrieves and processes digital receipts.
Receipt Identifier
A unique, persistent identifier for a specific receipt.
Receipt Endpoint
A URL where a digital receipt can be retrieved.

2. Conformance

As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.

2.1 Conformance Classes

This specification defines the following conformance classes:

2.1.1 DRP Receipt Provider

A DRP Receipt Provider must:

2.1.2 DRP Receipt Consumer

A DRP Receipt Consumer must:

3. Data Model

3.1 Overview

The DRP data model is based on Schema.org vocabulary extended with DRP-specific properties. The core entity is the Receipt which contains transaction details, merchant information, line items, payment information, and metadata.

3.2 Receipt Object

The Receipt object is the top-level container for all receipt data.

Property Type Required Description
@context String or Array Yes JSON-LD context, MUST include DRP context URL
@type String Yes MUST be "Receipt"
receiptId String Yes Unique identifier for this receipt
receiptNumber String No Human-readable receipt number
dateIssued DateTime Yes ISO 8601 timestamp of transaction
merchant Organization Yes Merchant information
location Place No Physical location of transaction
items Array[LineItem] Yes Items or services purchased
totalPrice MonetaryAmount Yes Total amount paid
subtotal MonetaryAmount No Subtotal before taxes and fees
tax Array[TaxAmount] No Tax amounts applied
discount Array[Discount] No Discounts applied
tip MonetaryAmount No Gratuity amount
paymentMethod PaymentMethod Yes Payment method used
customer Person or Organization No Customer information (privacy-sensitive)
metadata Object No Additional structured metadata
signature DigitalSignature Yes Cryptographic signature

3.3 LineItem Object

Represents an individual item or service on the receipt.

Property Type Required Description
@type String Yes MUST be "LineItem"
name String Yes Item name or description
sku String No Stock keeping unit identifier
gtin String No Global Trade Item Number (barcode)
quantity Number Yes Quantity purchased
unitPrice MonetaryAmount Yes Price per unit
totalPrice MonetaryAmount Yes Total price for this line item
category String No Product category
discount Array[Discount] No Discounts applied to this item
tax Array[TaxAmount] No Taxes applied to this item
warranty Warranty No Warranty information
returnPolicy ReturnPolicy No Return policy for this item

3.4 Organization (Merchant) Object

Property Type Required Description
@type String Yes MUST be "Organization"
name String Yes Legal business name
taxId String No Tax identification number
address PostalAddress Yes Business address
telephone String No Contact phone number
email String No Contact email address
url URL No Merchant website
logo URL or ImageObject No Merchant logo

3.5 MonetaryAmount Object

Property Type Required Description
@type String Yes MUST be "MonetaryAmount"
value Number Yes Numeric value
currency String Yes ISO 4217 currency code

3.6 PaymentMethod Object

Property Type Required Description
@type String Yes "PaymentCard", "PaymentService", "Cash", etc.
name String No Payment method name
cardType String No Card brand (Visa, Mastercard, etc.)
lastFourDigits String No Last 4 digits of card (if applicable)
authorizationCode String No Payment authorization code
transactionId String No Payment processor transaction ID

3.7 TaxAmount Object

Property Type Required Description
@type String Yes MUST be "TaxAmount"
name String Yes Tax name (e.g., "Sales Tax", "VAT")
rate Number No Tax rate as percentage
amount MonetaryAmount Yes Tax amount
taxId String No Tax jurisdiction identifier

3.8 DigitalSignature Object

Property Type Required Description
@type String Yes MUST be "DigitalSignature"
algorithm String Yes Signature algorithm (e.g., "RS256", "ES256")
signatureValue String Yes Base64-encoded signature
publicKey URL or String Yes Public key or key reference
created DateTime Yes Signature creation timestamp
nonce String No Unique value to prevent replay

4. JSON-LD Serialization

4.1 Format Requirements

DRP receipts must be serialized as JSON-LD documents. The JSON-LD context must include:

"@context": [
  "https://schema.org",
  "https://www.w3.org/ns/drp/v1"
]

4.2 Complete Example

Example: Basic Digital Receipt

{
  "@context": [
    "https://schema.org",
    "https://www.w3.org/ns/drp/v1"
  ],
  "@type": "Receipt",
  "receiptId": "urn:uuid:550e8400-e29b-41d4-a716-446655440000",
  "receiptNumber": "TXN-2024-001234",
  "dateIssued": "2024-12-04T14:32:00-06:00",
  "merchant": {
    "@type": "Organization",
    "name": "Acme Electronics Store",
    "taxId": "12-3456789",
    "address": {
      "@type": "PostalAddress",
      "streetAddress": "123 Main Street",
      "addressLocality": "Chicago",
      "addressRegion": "IL",
      "postalCode": "60601",
      "addressCountry": "US"
    },
    "telephone": "+1-312-555-0100",
    "email": "support@acmeelectronics.example",
    "url": "https://acmeelectronics.example"
  },
  "location": {
    "@type": "Place",
    "name": "Acme Electronics - Downtown",
    "address": {
      "@type": "PostalAddress",
      "streetAddress": "123 Main Street",
      "addressLocality": "Chicago",
      "addressRegion": "IL",
      "postalCode": "60601",
      "addressCountry": "US"
    }
  },
  "items": [
    {
      "@type": "LineItem",
      "name": "Wireless Bluetooth Headphones",
      "sku": "WBH-2000-BLK",
      "gtin": "00012345678905",
      "quantity": 1,
      "unitPrice": {
        "@type": "MonetaryAmount",
        "value": 79.99,
        "currency": "USD"
      },
      "totalPrice": {
        "@type": "MonetaryAmount",
        "value": 79.99,
        "currency": "USD"
      },
      "category": "Electronics > Audio > Headphones",
      "warranty": {
        "@type": "Warranty",
        "duration": "P1Y",
        "url": "https://acmeelectronics.example/warranty/WBH-2000"
      }
    },
    {
      "@type": "LineItem",
      "name": "USB-C Cable (2m)",
      "sku": "CBL-USBC-2M",
      "gtin": "00012345678912",
      "quantity": 2,
      "unitPrice": {
        "@type": "MonetaryAmount",
        "value": 12.99,
        "currency": "USD"
      },
      "totalPrice": {
        "@type": "MonetaryAmount",
        "value": 25.98,
        "currency": "USD"
      },
      "category": "Electronics > Accessories > Cables"
    }
  ],
  "subtotal": {
    "@type": "MonetaryAmount",
    "value": 105.97,
    "currency": "USD"
  },
  "tax": [
    {
      "@type": "TaxAmount",
      "name": "Illinois Sales Tax",
      "rate": 6.25,
      "amount": {
        "@type": "MonetaryAmount",
        "value": 6.62,
        "currency": "USD"
      },
      "taxId": "IL-SALES-TAX"
    },
    {
      "@type": "TaxAmount",
      "name": "Chicago Municipal Tax",
      "rate": 1.25,
      "amount": {
        "@type": "MonetaryAmount",
        "value": 1.32,
        "currency": "USD"
      },
      "taxId": "CHI-MUNICIPAL-TAX"
    }
  ],
  "discount": [
    {
      "@type": "Discount",
      "name": "Member Discount",
      "code": "MEMBER10",
      "amount": {
        "@type": "MonetaryAmount",
        "value": -10.60,
        "currency": "USD"
      }
    }
  ],
  "totalPrice": {
    "@type": "MonetaryAmount",
    "value": 103.31,
    "currency": "USD"
  },
  "paymentMethod": {
    "@type": "PaymentCard",
    "name": "Credit Card",
    "cardType": "Visa",
    "lastFourDigits": "4321",
    "authorizationCode": "AUTH123456",
    "transactionId": "TXN-PROC-789012"
  },
  "metadata": {
    "employeeId": "EMP-5678",
    "registerId": "REG-03",
    "receiptUrl": "https://receipts.acmeelectronics.example/550e8400-e29b-41d4-a716-446655440000"
  },
  "signature": {
    "@type": "DigitalSignature",
    "algorithm": "RS256",
    "signatureValue": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
    "publicKey": "https://receipts.acmeelectronics.example/.well-known/jwks.json",
    "created": "2024-12-04T14:32:05-06:00",
    "nonce": "a3f2b1c9d8e7"
  }
}

4.3 Extensions

Implementations may extend the data model with additional properties for industry-specific needs. Extensions should use namespaced property names to avoid conflicts.

Example: Restaurant-specific extension

{
  "@context": [
    "https://schema.org",
    "https://www.w3.org/ns/drp/v1",
    {
      "restaurant": "https://example.org/restaurant-extension#"
    }
  ],
  "@type": "Receipt",
  "receiptId": "urn:uuid:123e4567-e89b-12d3-a456-426614174000",
  "restaurant:tableNumber": "42",
  "restaurant:serverName": "Jane Smith",
  "restaurant:partySize": 4,
  "tip": {
    "@type": "MonetaryAmount",
    "value": 15.00,
    "currency": "USD"
  }
}

5. Receipt Discovery

5.1 Overview

Receipt discovery enables consumers to locate and retrieve digital receipts. DRP defines multiple discovery mechanisms to accommodate different use cases.

5.2 QR Code Discovery

Merchants may provide QR codes containing receipt URLs.

5.2.1 QR Code Format

The QR code must encode a URL in the following format:

https://receipts.example.com/r/{receiptId}?v=1&h={hash}

Where:

5.3 Email-based Discovery

Receipt providers may send receipts via email containing:

Example: HTML email with embedded receipt

<html>
  <head>
    <script type="application/ld+json">
    {
      "@context": ["https://schema.org", "https://www.w3.org/ns/drp/v1"],
      "@type": "Receipt",
      ...
    }
    </script>
  </head>
  <body>
    <h1>Your Receipt from Acme Electronics</h1>
    <p><a href="https://receipts.acmeelectronics.example/550e8400">
      View Digital Receipt
    </a></p>
  </body>
</html>

5.4 NFC-based Discovery

For NFC-enabled devices, merchants may provide NFC tags containing receipt URLs using NDEF format.

NDEF Record:
  TNF: Well Known
  Type: U (URI)
  Payload: https://receipts.example.com/r/{receiptId}

5.5 Digital Wallet Integration

Payment systems may include receipt endpoints in payment authorization responses, enabling automatic receipt delivery to consumer wallets.

5.6 Well-Known URI

Receipt providers should publish their receipt service metadata at:

https://example.com/.well-known/drp-config.json

Example: DRP Configuration

{
  "version": "1.0",
  "issuer": "https://receipts.acmeelectronics.example",
  "receiptEndpoint": "https://receipts.acmeelectronics.example/api/receipts",
  "jwksUri": "https://receipts.acmeelectronics.example/.well-known/jwks.json",
  "supportedFormats": ["application/ld+json", "application/pdf"],
  "features": ["digital-signature", "search", "archival"],
  "privacyPolicy": "https://acmeelectronics.example/privacy",
  "termsOfService": "https://acmeelectronics.example/terms"
}

6. Receipt Transmission Protocol

6.1 HTTP-based Retrieval

Receipt providers must support HTTP GET requests to retrieve receipts.

6.1.1 Request Format

GET /api/receipts/{receiptId} HTTP/1.1
Host: receipts.example.com
Accept: application/ld+json
Authorization: Bearer {access_token}
DRP-Version: 1.0

6.1.2 Response Format

HTTP/1.1 200 OK
Content-Type: application/ld+json
Cache-Control: private, max-age=31536000
ETag: "550e8400-e29b-41d4-a716-446655440000-v1"

{
  "@context": ["https://schema.org", "https://www.w3.org/ns/drp/v1"],
  "@type": "Receipt",
  ...
}

6.1.3 Headers

Header Required Description
DRP-Version Yes Protocol version (currently "1.0")
Authorization Yes* Bearer token for authenticated access
Accept No Preferred response format
If-None-Match No ETag for conditional requests

*Required for non-public receipts

6.2 Push Delivery

Receipt providers may support push delivery via webhooks.

6.2.1 Webhook Registration

POST /api/webhooks HTTP/1.1
Host: receipts.example.com
Content-Type: application/json
Authorization: Bearer {access_token}

{
  "url": "https://consumer-app.example/webhooks/receipts",
  "events": ["receipt.created", "receipt.updated"],
  "secret": "webhook_secret_key"
}

6.2.2 Webhook Delivery

POST /webhooks/receipts HTTP/1.1
Host: consumer-app.example
Content-Type: application/ld+json
X-DRP-Event: receipt.created
X-DRP-Signature: sha256=d8f2a1c3b4e5...

{
  "@context": ["https://schema.org", "https://www.w3.org/ns/drp/v1"],
  "@type": "Receipt",
  ...
}

6.3 Batch Retrieval

Implementations may support batch receipt retrieval for efficiency.

POST /api/receipts/batch HTTP/1.1
Host: receipts.example.com
Content-Type: application/json
Authorization: Bearer {access_token}

{
  "receiptIds": [
    "550e8400-e29b-41d4-a716-446655440000",
    "660e8400-e29b-41d4-a716-446655440001"
  ]
}

HTTP/1.1 200 OK
Content-Type: application/json

{
  "receipts": [
    { "@type": "Receipt", ... },
    { "@type": "Receipt", ... }
  ]
}

7. Cryptographic Signatures

7.1 Signature Requirements

All receipts must be digitally signed by the issuing merchant or receipt provider. Signatures prevent tampering and enable verification of receipt authenticity.

7.2 Supported Algorithms

Implementations must support at least one of:

7.3 Signing Process

  1. Create the complete receipt JSON-LD document without the signature field
  2. Canonicalize the JSON using JSON Canonicalization Scheme (JCS, RFC 8785)
  3. Compute the hash of the canonicalized document (SHA-256)
  4. Sign the hash using the private key
  5. Encode the signature in Base64
  6. Add the signature object to the receipt

Example: Signing pseudocode

// 1. Prepare receipt without signature
const receipt = {
  "@context": [...],
  "@type": "Receipt",
  "receiptId": "...",
  // ... other fields
};

// 2. Canonicalize
const canonical = canonicalize(receipt);

// 3. Hash
const hash = sha256(canonical);

// 4. Sign
const signature = sign(hash, privateKey, "RS256");

// 5. Encode
const signatureValue = base64encode(signature);

// 6. Add signature
receipt.signature = {
  "@type": "DigitalSignature",
  "algorithm": "RS256",
  "signatureValue": signatureValue,
  "publicKey": "https://receipts.example.com/.well-known/jwks.json",
  "created": new Date().toISOString(),
  "nonce": generateNonce()
};

7.4 Verification Process

  1. Extract the signature object from the receipt
  2. Remove the signature field from the receipt
  3. Canonicalize the remaining receipt data
  4. Compute the hash (SHA-256)
  5. Retrieve the public key from the specified location
  6. Verify the signature against the hash
  7. Check signature timestamp is reasonable (not too old or in future)

7.5 Public Key Distribution

Receipt providers must publish public keys using JSON Web Key Set (JWKS) format at a well-known URL.

Example: JWKS endpoint

GET /.well-known/jwks.json HTTP/1.1
Host: receipts.example.com

HTTP/1.1 200 OK
Content-Type: application/json

{
  "keys": [
    {
      "kty": "RSA",
      "use": "sig",
      "kid": "2024-12-key-1",
      "n": "xGOr-H7A-D...",
      "e": "AQAB",
      "alg": "RS256"
    }
  ]
}

7.6 Key Rotation

Receipt providers should rotate signing keys periodically (recommended: annually). Old public keys must remain available for historical receipt verification.

8. Privacy and Security Considerations

8.1 Personal Information Protection

Receipt providers must minimize collection and storage of personally identifiable information (PII). The customer field should only be included when explicitly requested or required for business purposes.

Privacy Warning: Customer names, email addresses, phone numbers, and detailed payment information should only be included with explicit user consent and appropriate security measures.

8.2 Access Control

Receipt endpoints must implement authentication and authorization:

8.2.1 OAuth 2.0 Integration

GET /api/receipts/550e8400-e29b-41d4-a716-446655440000 HTTP/1.1
Host: receipts.example.com
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...

8.3 Data Retention

Receipt providers should establish clear retention policies. Consumers must have the ability to:

8.4 Transport Security

All receipt transmissions must use TLS 1.2 or higher. Receipt endpoints must not accept unencrypted HTTP connections.

8.5 Anonymization

For analytics or aggregated reporting, receipt providers should anonymize data by:

8.6 GDPR and Privacy Regulations

Receipt providers operating in jurisdictions with data protection regulations must comply with applicable laws including:

9. Error Handling

9.1 HTTP Status Codes

Status Code Meaning Usage
200 OK Success Receipt retrieved successfully
304 Not Modified Cached Receipt unchanged (ETag match)
400 Bad Request Invalid request Malformed receipt ID or parameters
401 Unauthorized Not authenticated Missing or invalid authentication
403 Forbidden Not authorized Valid auth but insufficient permissions
404 Not Found Receipt not found Receipt ID does not exist
410 Gone Deleted Receipt was permanently deleted
429 Too Many Requests Rate limited Too many requests in time window
500 Internal Server Error Server error Unexpected server error
503 Service Unavailable Temporarily unavailable Maintenance or overload

9.2 Error Response Format

Error responses should include a JSON body with details:

Example: Error response

HTTP/1.1 404 Not Found
Content-Type: application/json

{
  "error": {
    "code": "receipt_not_found",
    "message": "Receipt with ID '550e8400-e29b-41d4-a716-446655440000' was not found",
    "details": {
      "receiptId": "550e8400-e29b-41d4-a716-446655440000",
      "timestamp": "2024-12-04T14:32:00Z"
    },
    "documentationUrl": "https://docs.drp.example/errors/receipt_not_found"
  }
}

9.3 Validation Errors

For validation failures, include field-specific error details:

{
  "error": {
    "code": "validation_error",
    "message": "Receipt validation failed",
    "validationErrors": [
      {
        "field": "totalPrice.value",
        "message": "Total price does not match sum of line items",
        "expected": 103.31,
        "actual": 100.00
      },
      {
        "field": "signature.algorithm",
        "message": "Unsupported signature algorithm",
        "provided": "HS256",
        "supported": ["RS256", "ES256", "PS256"]
      }
    ]
  }
}

10. Internationalization

10.1 Language Support

Receipt text content should be provided in the consumer's preferred language when available. Use the Accept-Language HTTP header for language negotiation.

GET /api/receipts/550e8400 HTTP/1.1
Accept-Language: es-MX, es;q=0.9, en;q=0.8

10.2 Localized Content

Implementations may use JSON-LD language maps for multilingual content:

{
  "@type": "LineItem",
  "name": {
    "@value": "Audífonos Bluetooth Inalámbricos",
    "@language": "es"
  },
  "name": {
    "@value": "Wireless Bluetooth Headphones",
    "@language": "en"
  }
}

10.3 Currency and Formatting

All monetary amounts must include ISO 4217 currency codes. Display formatting should follow locale conventions but storage uses standardized decimal representation.

10.4 Date and Time

All timestamps must use ISO 8601 format with timezone information:

"dateIssued": "2024-12-04T14:32:00-06:00"

11. Accessibility

11.1 Accessibility Requirements

Receipt presentations (web views, apps, etc.) must conform to WCAG 2.1 Level AA guidelines:

11.2 Alternative Formats

Receipt providers should offer receipts in multiple formats:

GET /api/receipts/550e8400 HTTP/1.1
Accept: text/html

HTTP/1.1 200 OK
Content-Type: text/html

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Receipt - Acme Electronics</title>
  </head>
  <body>
    <main role="main">
      <h1>Receipt</h1>
      ...
    </main>
  </body>
</html>

12. Extension Mechanisms

12.1 Custom Properties

Implementations may add custom properties using namespaced names. Custom properties should use reverse domain notation or explicit context URLs.

{
  "@context": [
    "https://schema.org",
    "https://www.w3.org/ns/drp/v1",
    {
      "acme": "https://acmeelectronics.example/receipt-extension#"
    }
  ],
  "acme:loyaltyPoints": 150,
  "acme:rewardsProgram": "Gold Member"
}

12.2 Industry Extensions

Industry-specific extensions may define additional types and properties. Common extensions include:

13. IANA Considerations

13.1 Media Type Registration

This specification registers the following media type:

Type name:
application
Subtype name:
drp+json
Required parameters:
None
Optional parameters:
version (default: "1.0")
Encoding considerations:
UTF-8
Security considerations:
See Section 8 of this specification
Interoperability considerations:
This format extends JSON-LD and is compatible with JSON-LD processors
Published specification:
This document
Applications that use this media type:
Digital receipt systems, expense management applications, accounting software

13.2 Well-Known URI Registration

This specification registers the following well-known URI:

URI suffix:
drp-config.json
Change controller:
W3C
Specification document:
This document, Section 5.6
Related information:
None

14. Additional Examples

14.1 Restaurant Receipt

{
  "@context": ["https://schema.org", "https://www.w3.org/ns/drp/v1"],
  "@type": "Receipt",
  "receiptId": "urn:uuid:789e4567-e89b-12d3-a456-426614174000",
  "receiptNumber": "TABLE-42-2024-1204",
  "dateIssued": "2024-12-04T19:45:00-06:00",
  "merchant": {
    "@type": "Restaurant",
    "name": "The Blue Bistro",
    "address": {
      "@type": "PostalAddress",
      "streetAddress": "456 Oak Avenue",
      "addressLocality": "Chicago",
      "addressRegion": "IL",
      "postalCode": "60614",
      "addressCountry": "US"
    }
  },
  "items": [
    {
      "@type": "LineItem",
      "name": "Caesar Salad",
      "quantity": 2,
      "unitPrice": {"@type": "MonetaryAmount", "value": 12.00, "currency": "USD"},
      "totalPrice": {"@type": "MonetaryAmount", "value": 24.00, "currency": "USD"}
    },
    {
      "@type": "LineItem",
      "name": "Grilled Salmon",
      "quantity": 1,
      "unitPrice": {"@type": "MonetaryAmount", "value": 28.00, "currency": "USD"},
      "totalPrice": {"@type": "MonetaryAmount", "value": 28.00, "currency": "USD"}
    },
    {
      "@type": "LineItem",
      "name": "House Wine (Glass)",
      "quantity": 2,
      "unitPrice": {"@type": "MonetaryAmount", "value": 9.00, "currency": "USD"},
      "totalPrice": {"@type": "MonetaryAmount", "value": 18.00, "currency": "USD"}
    }
  ],
  "subtotal": {"@type": "MonetaryAmount", "value": 70.00, "currency": "USD"},
  "tax": [{
    "@type": "TaxAmount",
    "name": "Sales Tax",
    "rate": 10.25,
    "amount": {"@type": "MonetaryAmount", "value": 7.18, "currency": "USD"}
  }],
  "tip": {"@type": "MonetaryAmount", "value": 14.00, "currency": "USD"},
  "totalPrice": {"@type": "MonetaryAmount", "value": 91.18, "currency": "USD"},
  "paymentMethod": {
    "@type": "PaymentCard",
    "cardType": "Mastercard",
    "lastFourDigits": "5678"
  },
  "metadata": {
    "tableNumber": "42",
    "serverName": "Maria Garcia",
    "partySize": 2
  },
  "signature": {
    "@type": "DigitalSignature",
    "algorithm": "RS256",
    "signatureValue": "eyJhbGc...",
    "publicKey": "https://receipts.bluebistro.example/.well-known/jwks.json",
    "created": "2024-12-04T19:46:00-06:00"
  }
}

14.2 Subscription Service Receipt

{
  "@context": ["https://schema.org", "https://www.w3.org/ns/drp/v1"],
  "@type": "Receipt",
  "receiptId": "urn:uuid:890e4567-e89b-12d3-a456-426614174000",
  "receiptNumber": "SUB-2024-DEC-123456",
  "dateIssued": "2024-12-01T00:00:00Z",
  "merchant": {
    "@type": "Organization",
    "name": "StreamFlix Media Services",
    "url": "https://streamflix.example"
  },
  "items": [{
    "@type": "LineItem",
    "name": "Premium Plan - Monthly Subscription",
    "quantity": 1,
    "unitPrice": {"@type": "MonetaryAmount", "value": 15.99, "currency": "USD"},
    "totalPrice": {"@type": "MonetaryAmount", "value": 15.99, "currency": "USD"},
    "metadata": {
      "subscriptionId": "sub_1234567890",
      "billingPeriod": "2024-12-01/2025-01-01",
      "autoRenew": true,
      "nextBillingDate": "2025-01-01"
    }
  }],
  "totalPrice": {"@type": "MonetaryAmount", "value": 15.99, "currency": "USD"},
  "paymentMethod": {
    "@type": "PaymentCard",
    "cardType": "Visa",
    "lastFourDigits": "1234"
  },
  "signature": {
    "@type": "DigitalSignature",
    "algorithm": "ES256",
    "signatureValue": "MEUCIQD...",
    "publicKey": "https://api.streamflix.example/.well-known/jwks.json",
    "created": "2024-12-01T00:00:05Z"
  }
}

15. References

15.1 Normative References

[RFC2119]
Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC8259]
Bray, T., "The JavaScript Object Notation (JSON) Data Interchange Format", STD 90, RFC 8259, December 2017.
[RFC8785]
Rundgren, A., Jordan, B., and S. Erdtman, "JSON Canonicalization Scheme (JCS)", RFC 8785, June 2020.
[JSON-LD]
Sporny, M., Longley, D., Kellogg, G., Lanthaler, M., Lindström, N., "JSON-LD 1.1", W3C Recommendation, July 2020.
[SCHEMA-ORG]
Schema.org, "Schema.org - Schema.org", https://schema.org/
[ISO4217]
ISO 4217:2015, "Codes for the representation of currencies"
[ISO8601]
ISO 8601:2019, "Date and time — Representations for information interchange"

15.2 Informative References

[OAUTH2]
Hardt, D., "The OAuth 2.0 Authorization Framework", RFC 6749, October 2012.
[WCAG21]
Kirkpatrick, A., Connor, J., Campbell, A., Cooper, M., "Web Content Accessibility Guidelines (WCAG) 2.1", W3C Recommendation, June 2018.
[GDPR]
EU General Data Protection Regulation (GDPR), Regulation (EU) 2016/679
[RFC7515]
Jones, M., Bradley, J., Sakimura, N., "JSON Web Signature (JWS)", RFC 7515, May 2015.
[RFC7517]
Jones, M., "JSON Web Key (JWK)", RFC 7517, May 2015.

Acknowledgments

This specification builds upon work from the W3C Web Payments Working Group, Schema.org community, and various industry standards organizations. Special thanks to contributors from retail, hospitality, and technology sectors who provided real-world use cases and implementation feedback.

Appendix A: Implementation Checklist

Receipt Provider Checklist

Receipt Consumer Checklist

Appendix B: Security Best Practices