{"id":18645871,"url":"https://github.com/interledger/receipt-verifier","last_synced_at":"2025-04-11T12:31:40.618Z","repository":{"id":40727147,"uuid":"243605341","full_name":"interledger/receipt-verifier","owner":"interledger","description":"Handles ILP STREAM receipts","archived":false,"fork":false,"pushed_at":"2023-03-04T06:13:53.000Z","size":1353,"stargazers_count":11,"open_issues_count":10,"forks_count":2,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-02-05T09:13:56.218Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/interledger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-27T20:01:17.000Z","updated_at":"2023-07-29T01:24:31.000Z","dependencies_parsed_at":"2024-11-07T07:34:41.416Z","dependency_job_id":null,"html_url":"https://github.com/interledger/receipt-verifier","commit_stats":null,"previous_names":["coilhq/receipt-verifier"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interledger%2Freceipt-verifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interledger%2Freceipt-verifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interledger%2Freceipt-verifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interledger%2Freceipt-verifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/interledger","download_url":"https://codeload.github.com/interledger/receipt-verifier/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248401970,"owners_count":21097328,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T06:17:31.383Z","updated_at":"2025-04-11T12:31:40.298Z","avatar_url":"https://github.com/interledger.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Receipt Verifier\n\u003e Manages [Interledger STREAM](https://interledger.org/rfcs/0029-stream/) receipts\n\n[![npm version](https://badge.fury.io/js/%40coil%2Freceipt-verifier.svg)](https://badge.fury.io/js/%40coil%2Freceipt-verifier)\n![](https://github.com/wilsonianb/receipt-verifier/workflows/Node.js%20CI/badge.svg)\n\nSTREAM receipts allow recipients or third parties to verify received payments at the recipient's Interledger wallet.\n\nThe **Receipt Verifier**:\n\n1. pre-shares a secret key with the receiving wallet for generating receipts, by acting as a proxy for SPSP queries to the recipient's payment pointer\n2. verifies receipts\n\nFor [Web Monetization](https://github.com/interledger/rfcs/blob/master/0028-web-monetization/0028-web-monetization.md), website visitors submit receipts to the website in `monetizationprogress` events. The website backend can send receipts to the **Receipt Verifier** to confirm the payment.\n\n### Run\n\n```\nnpm install\nnpm run-script build\nsudo docker run -p 6379:6379 -d redis\nnpm start\n```\n\n### Environment Variables\n\n#### PORT\n* Type: [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)\n* Description: The port that Receipt Verifier API will listen on.\n* Default: 3000\n\n#### RECEIPT_SEED\n* Type: String\n* Description: Base64-encoded secret value used to generate receipt secret keys.\n* Default: random seed\n\n#### RECEIPT_TTL\n* Type: [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)\n* Description: The number of seconds since a stream's start time to consider a receipt valid.\n* Default: 300\n\n#### REDIS_URI\n* Type: String\n* Description: The URI at which to connect to Redis.\n* Default: redis://127.0.0.1:6379/\n\n#### SPSP_ENDPOINTS_URL\n* Type: String\n* Description: URL used to fetch a receiver's [SPSP endpoint](https://interledger.org/rfcs/0009-simple-payment-setup-protocol/) to which an SPSP query is proxied.\nFor each SPSP query, a GET request is sent to `SPSP_ENDPOINTS_URL` with the query's url path value (without the preceding slash) as the URI encoded `id` query parameter.\nThe response body is expected to be a string of the SPSP endpoint to proxy the SPSP query to.\n\n### API Documentation\n\n#### `GET /  Accept: application/spsp4+json`\nAdds receipt headers to [SPSP request](https://interledger.org/rfcs/0009-simple-payment-setup-protocol/) and proxies it to the receiver's SPSP endpoint.\n\nIf [`SPSP_ENDPOINTS_URL`](#spsp_endpoints_url) is configured, the request is proxied to the SPSP endpoint returned by the `SPSP_ENDPOINTS_URL`.\n* Example: if `SPSP_ENDPOINTS_URL=https://my-revshare.com`, `GET /users/alice` triggers a GET request to `https://my-revshare.com/?id=users%2Falice`. The SPSP request is then proxied to the SPSP endpoint in the response.\n\nOtherwise, the SPSP query is proxied to the URL encoded [payment pointer](https://paymentpointers.org/) or SPSP endpoint in the path of the SPSP request URL.\n* Example: `GET /%24wallet.com` (or `GET /https%3A%2F%2Fwallet.com%2F.well-known%2Fpay`) is proxied to `$wallet.com` (`https://wallet.com/.well-known/pay`).\n\n#### `POST /verify`\nVerifies receipt and returns value\n\n##### Request Body:\n* Type: String\n* Description: base64-encoded STREAM receipt\n\n##### Return Value:\n* Type: Object\n\n| Field Name   | Type   | Description              |\n|--------------|--------|--------------------------|\n| amount       | string | Amount by which this receipt exceeds the previously verified receipt's `totalReceived` |\n| id           | string | _OPTIONAL_ The URI decoded `id` that was used in the request to the `SPSP_ENDPOINTS_URL` |\n| spspEndpoint | string | SPSP endpoint to which the payment was sent |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterledger%2Freceipt-verifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finterledger%2Freceipt-verifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterledger%2Freceipt-verifier/lists"}