Please note that this is a draft spec and represents work in progress. We celebrate questions, comments and every attempt to assist us during the definition period.
RSRF is a proposal for an easy to use format for electronic receipts. It was created to encourage and facilitate the creation and exchange of electronic receipts.
The principal design goal for the format is simplicity. We're scratching our own itch and we do not want to create an all-encompassing format allowing for every edge-case that might occur when communicating data between sellers and customers. For that we already have the intricate and complex standards for wlectronic invoices.
An RSRF-receipt will allow it's recipient to answer the following questions:
- Where did I shop
- When did I shop
- What did I purchase
- What quantity of each product did I purchase
- At what price did I purchase the products
Each field has some rationale behind it that works towards these goals.
{
"version": "1",
"id": "123-456-789",
"date": "2017-06-05",
"time": "18:08:45.641",
"timeZone": "GMT",
"totalAmount": 844,
"currencyCode": "ISK",
"seller": {
"id": "987-654-321",
"governmentID": "091179-4829",
"name": "the Great shop",
"emailAddress": "the.great@shop.com"
},
"entries": [
{
"description": "Soylent Industries Green no. 3",
"productCode": "5690527101004",
"quantity": 1,
"unitPrice": 155,
"totalAmount": 155,
"vatPercentage": 0.11
},
{
"description": "Gurble Farms Whole Grain Bread",
"productCode": "5690568010235",
"quantity": 2,
"unitPrice": 387,
"discountPercentage": 0.10,
"totalAmount": 689,
"vatPercentage": 0.11
}
]
}
The spec defines three types of objects. A receipt is the base object. receipt contains entry objects that are lines that describe each purchased item. receipt objects can also contain attachment objects that are just blobs of data. An attachment could for example contain a rendered image or PDF-version of the receipt.
Required. Version of the spec used by the receipt.
Required. String. This is the unique ID of your receipt within your store.
Required. Date of purchase. String formatted as specified by ISO-8601.
Optional. Time of purchase. String, formatted as specified by ISO-8601.
Required. Timezone of seller. String, formatted as specified by ISO-8601.
Optional. Discount percentage, if applicable. Formatted as a decimal (0.10 for 10%). Only one of discountAmount or discountPercentage can be specified.
Optional. Discount amount, if applicable. Only one of discountAmount or discountPercentage can be specified.
Required. Total amount paid.
Required. String. Code of the currency, as specified by ISO-4217.
Required. Information on the seller, as specified by the Seller object.
Optional. List of Entry objects denoting what was purcased.
Optional. List of Attachment objects containing, for example, a rendered image or PDF of the receipt, the shop logo etc.
Optional. String. A globally unique ID of the shop. Currently, only we (Strimillinn) assign these identifiers so please contact us to get one. If you're in Iceland, you probably already have one. We'd like to make this an open process in the future.
Optional. String. The national ID number of the seller (in Iceland, this would be the "kennitala").
Optional. String. E-mail address of the seller.
Optional. String. Location of the shop as specified by ISO-6709.
Required. Description of the purchased product.
Required. Quantity purchased, either number of units, weight etc.
Required. Price of each unit of the purchased product.
Required. Total amount paid.
Optional. Product number (UPC) of the purchased product.
Optional. Discount percentage, if applicable. Formatted as a decimal (0.10 for 10%). Only one of discountAmount or discountPercentage can be specified.
Optional. Discount amount, if applicable. Only one of discountAmount or discountPercentage can be specified.
Optional. Percentage of VAT paid. Formatted as a decimal (0.24 for 24%).
Required. Human readable document name. Displayed to the user. A document extension is required for the system to identify the document type when serving it to the user.
Required. Base64 encoded data of the document.