{"id":25296078,"url":"https://github.com/selfkeyfoundation/relying-party-mp-kycc-demo","last_synced_at":"2025-09-20T01:21:58.728Z","repository":{"id":42899320,"uuid":"252719496","full_name":"SelfKeyFoundation/relying-party-mp-kycc-demo","owner":"SelfKeyFoundation","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-24T01:54:11.000Z","size":2588,"stargazers_count":0,"open_issues_count":15,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-06T20:49:48.500Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SelfKeyFoundation.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}},"created_at":"2020-04-03T11:59:39.000Z","updated_at":"2020-04-08T17:23:52.000Z","dependencies_parsed_at":"2023-02-13T10:16:48.048Z","dependency_job_id":null,"html_url":"https://github.com/SelfKeyFoundation/relying-party-mp-kycc-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SelfKeyFoundation/relying-party-mp-kycc-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SelfKeyFoundation%2Frelying-party-mp-kycc-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SelfKeyFoundation%2Frelying-party-mp-kycc-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SelfKeyFoundation%2Frelying-party-mp-kycc-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SelfKeyFoundation%2Frelying-party-mp-kycc-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SelfKeyFoundation","download_url":"https://codeload.github.com/SelfKeyFoundation/relying-party-mp-kycc-demo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SelfKeyFoundation%2Frelying-party-mp-kycc-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276028169,"owners_count":25572673,"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","status":"online","status_checked_at":"2025-09-19T02:00:09.700Z","response_time":108,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-02-13T02:55:39.906Z","updated_at":"2025-09-20T01:21:58.693Z","avatar_url":"https://github.com/SelfKeyFoundation.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Login With Selfkey Demo for KYCC users\n\n## Contents\n\n- [Usage](#usage)\n- [Integration With KYC-Chain](#kycc-integration)\n- [License](#license)\n\n\u003ca name=\"usage\"\u003e\u003c/a\u003e\n\n## Usage\n\n### Install\n\n```sh\ngit clone https://github.com/SelfKeyFoundation/relying-party-mp-kycc-demo.git\ncd relying-party-mp-kycc-demo\nyarn install\n```\n\n### KYC-Chain config\n\nexport 2  env variables if you run directly\n```\nKYCC_API_URL=http://instance-id.kyc-chain.com/\nKYCC_API_KEY=my-kycc-api-keu\n```\n\nor create an `.env` file containing them if you run with `docker-compose`\n\n### Run\n\n```sh\nyarn start\n```\n\n### Or with docker\n\n```sh\ndocker-compose up\n```\n\u003ca name=\"kycc-integration\"\u003e\u003c/a\u003e\n\n## Integration with KYC-Chain\n\n### Prerequisites\n\n- the webhook endpoint that is exposed on your server should be configured on KYC-Chain instance\n- you should get an API key for the instance\n\n### Handle webhook events\n\nThe webhook endpoint will receive post request from KYC-Chain instance on any status change of an application.\n\nThe request payload will contain application id and status\n\n```js\n{\n    applicationId: '5e8c782aa88e7b00139f589d',\n    status: 2,\n    updatedAt: '2020-04-08T12:26:26.479Z'\n}\n```\n\nPossible application status codes are:\n\n```js\n{\n    MISSING: 0,\n    IN_PROGRESS: 1,\n    APPROVED: 2,\n    REJECTED: 3,\n    UPLOADED: 4,\n    INVITED: 5,\n    USER_PROCESSING: 6,\n    USER_DECLINED: 7,\n    CANCELED: 8,\n    ADDITIONAL_REQUESTED: 9,\n    CORPORATE_DETAILS: 10,\n    USER_PROCESSING_REQUIREMENT: 11,\n    PARTIALLY_APPROVED: 12,\n    SEND_TOKENS: 13,\n    MANAGER_ASSIGNED: 14,\n    DATA_CHECK: 15,\n    REOPENED: 16\n};\n```\n\nExample: [routes/webhook.js](https://github.com/SelfKeyFoundation/relying-party-mp-kycc-demo/blob/master/src/routes/webhook.js#L8)\n\n### Control the application via KYC-Chain API\n\nThere are 2 official options to work with KYC-Chain API\n\n- use our Node.js client lib\n- directly perform http requests\n\n### Install node.js client\n\n[Github](https://github.com/SelfKeyFoundation/selfkey-lib)\n\n```bash\nnpm install --save @selfkey/node-lib\n```\n\n### Initialize node.js client\n\n```js\nconst sk = require('@selfkey/node-lib');\nconst client = sk.kycc.createKYCCIntegrationsClient({\n    apiKey: \"\u003cKYCC_API_KEY\u003e\",\n    instanceUrl: \"\u003cKYCC_API_URL\u003e\"\n});\n```\n\nExample: [kycc-client.js](https://github.com/SelfKeyFoundation/relying-party-mp-kycc-demo/blob/master/src/kycc-client.js)\n\n### Get detailed application object\n\n#### Node.js\n\n```js\nconst application = await kyccClient.applications.get(applicationId);\n```\n\nExample: [routes/webhook.js](https://github.com/SelfKeyFoundation/relying-party-mp-kycc-demo/blob/master/src/routes/webhook.js#L12)\n\n#### HTTP\n\n```bash\nGET \u003cKYCC_API_KEY\u003e/integrations/v2/applications/\u003cAPPLICATION_ID\u003e\n\nHEADERS:\napiKey: \u003cKYCC_API_URL\u003e\n```\n\n#### Example Response:\n\n```js\n{\n    \"attributes\": {\n        \"5e81d956f52e300013c7e5c1\": {\n            \"description\": \"Please enter your e-mail address.\",\n            \"isAdditional\": false,\n            \"label\": \"Email\",\n            \"optional\": false,\n            \"schema\": \"http://platform.selfkey.org/schema/attribute/email.json\",\n            \"valid\": true,\n            \"value\": \"test3@test.com\"\n        },\n        \"5e81d956f52e300013c7e5c2\": {\n            \"description\": \"First name\",\n            \"isAdditional\": false,\n            \"label\": \"First name\",\n            \"optional\": false,\n            \"schema\": \"http://platform.selfkey.org/schema/attribute/first-name.json\",\n            \"valid\": false,\n            \"value\": \"Test\"\n        },\n        \"5e81d956f52e300013c7e5c3\": {\n            \"description\": \"Middle name\",\n            \"isAdditional\": false,\n            \"label\": \"Middle name\",\n            \"optional\": true,\n            \"schema\": \"http://platform.selfkey.org/schema/attribute/middle-name.json\",\n            \"valid\": false,\n            \"value\": \"test\"\n        },\n        \"5e81d956f52e300013c7e5c4\": {\n            \"description\": \"Last name\",\n            \"isAdditional\": false,\n            \"label\": \"Last name\",\n            \"optional\": false,\n            \"schema\": \"http://platform.selfkey.org/schema/attribute/last-name.json\",\n            \"valid\": true,\n            \"value\": \"test\"\n        },\n        \"5e81d9d6f52e300013c7e5c6\": {\n            \"description\": \"Bank Statement\",\n            \"isAdditional\": false,\n            \"label\": \"Bank Statement\",\n            \"optional\": false,\n            \"schema\": \"http://platform.selfkey.org/schema/attribute/bank-statement.json\",\n            \"valid\": true,\n            \"value\": {\n                \"issued\": \"2020-04-01\",\n                \"images\": [\n                    {\n                        \"content\": \"5e8c7864a88e7b00139f58ac\",\n                        \"mimeType\": \"image/png\",\n                        \"size\": 147726\n                    }\n                ]\n            }\n        }\n    },\n    \"dataChecks\": [],\n    \"forms\": [],\n    \"notes\": [\n        {\n            \"_id\": \"5e8c85c2a88e7b00139f58d2\",\n            \"external\": false,\n            \"content\": \"I am approving this application\",\n            \"owner\": \"5d25a03ff784627fe5b96918\",\n            \"createdAt\": \"2020-04-07T13:53:06.748Z\"\n        },\n        {\n            \"_id\": \"5e8c8632a88e7b00139f58d7\",\n            \"external\": false,\n            \"content\": \"application reopened\",\n            \"owner\": \"5d25a03ff784627fe5b96918\",\n            \"createdAt\": \"2020-04-07T13:54:58.266Z\"\n        },\n        {\n            \"_id\": \"5e8c8851a88e7b00139f58dd\",\n            \"external\": false,\n            \"content\": \"I am approving this application\",\n            \"owner\": \"5d25a03ff784627fe5b96918\",\n            \"createdAt\": \"2020-04-07T14:04:01.784Z\"\n        },\n        {\n            \"_id\": \"5e8c8991a88e7b00139f58e1\",\n            \"external\": false,\n            \"content\": \"application reopened\",\n            \"owner\": \"5d25a03ff784627fe5b96918\",\n            \"createdAt\": \"2020-04-07T14:09:21.594Z\"\n        },\n        {\n            \"_id\": \"5e8c89bfa88e7b00139f58e7\",\n            \"external\": false,\n            \"content\": \"I am approving this application\",\n            \"owner\": \"5d25a03ff784627fe5b96918\",\n            \"createdAt\": \"2020-04-07T14:10:07.975Z\"\n        },\n        {\n            \"_id\": \"5e8c9285a88e7b00139f58eb\",\n            \"external\": false,\n            \"content\": \"application reopened\",\n            \"owner\": \"5d25a03ff784627fe5b96918\",\n            \"createdAt\": \"2020-04-07T14:47:33.428Z\"\n        }\n    ],\n    \"owners\": [\n        {\n            \"_id\": \"5e8c782aa88e7b00139f589c\",\n            \"email\": \"test3@test.com\"\n        }\n    ],\n    \"payments\": [],\n    \"questions\": {},\n    \"requirementsLog\": {\n        \"5e81d956f52e300013c7e5c2\": [\n            {\n                \"action\": \"invalidation\",\n                \"createdAt\": \"2020-04-07T12:57:39.575Z\",\n                \"manager\": \"5d25a03ff784627fe5b96918\",\n                \"comments\": []\n            }\n        ],\n        \"5e81d956f52e300013c7e5c3\": [\n            {\n                \"action\": \"invalidation\",\n                \"createdAt\": \"2020-04-07T12:57:39.575Z\",\n                \"manager\": \"5d25a03ff784627fe5b96918\",\n                \"comments\": []\n            }\n        ]\n    },\n    \"type\": \"individual\",\n    \"memberTemplates\": [],\n    \"template\": {\n        \"_id\": \"5e81d956f52e300013c7e5be\",\n        \"requirements\": {\n            \"questions\": [\n                {\n                    \"datepicker\": false,\n                    \"multiple\": false,\n                    \"optional\": false,\n                    \"options\": [],\n                    \"type\": \"kyc\",\n                    \"weight\": 0,\n                    \"_id\": \"5e81d956f52e300013c7e5c1\",\n                    \"attributeType\": \"http://platform.selfkey.org/schema/attribute/email.json\",\n                    \"description\": \"Please enter your e-mail address.\",\n                    \"question\": \"Email\",\n                    \"title\": \"Email\"\n                },\n                {\n                    \"datepicker\": false,\n                    \"multiple\": false,\n                    \"optional\": false,\n                    \"options\": [],\n                    \"type\": \"kyc\",\n                    \"weight\": 0,\n                    \"_id\": \"5e81d956f52e300013c7e5c2\",\n                    \"attributeType\": \"http://platform.selfkey.org/schema/attribute/first-name.json\",\n                    \"description\": \"First name\",\n                    \"question\": \"First name\",\n                    \"title\": \"First name\"\n                },\n                {\n                    \"datepicker\": false,\n                    \"multiple\": false,\n                    \"optional\": true,\n                    \"options\": [],\n                    \"type\": \"kyc\",\n                    \"weight\": 0,\n                    \"_id\": \"5e81d956f52e300013c7e5c3\",\n                    \"attributeType\": \"http://platform.selfkey.org/schema/attribute/middle-name.json\",\n                    \"description\": \"Middle name\",\n                    \"question\": \"Middle name\",\n                    \"title\": \"Middle name\"\n                },\n                {\n                    \"datepicker\": false,\n                    \"multiple\": false,\n                    \"optional\": false,\n                    \"options\": [],\n                    \"type\": \"kyc\",\n                    \"weight\": 0,\n                    \"_id\": \"5e81d956f52e300013c7e5c4\",\n                    \"attributeType\": \"http://platform.selfkey.org/schema/attribute/last-name.json\",\n                    \"description\": \"Last name\",\n                    \"question\": \"Last name\",\n                    \"title\": \"Last name\"\n                }\n            ],\n            \"uploads\": [\n                {\n                    \"certifiedTrueCopy\": {\n                        \"offSystem\": false,\n                        \"onSystem\": false\n                    },\n                    \"notary\": {\n                        \"offSystem\": false,\n                        \"onSystem\": false\n                    },\n                    \"idScan\": false,\n                    \"optional\": false,\n                    \"selfie\": false,\n                    \"signature\": false,\n                    \"weight\": 0,\n                    \"_id\": \"5e81d9d6f52e300013c7e5c6\",\n                    \"attributeType\": \"http://platform.selfkey.org/schema/attribute/bank-statement.json\",\n                    \"title\": \"Bank Statement\",\n                    \"description\": \"Bank Statement\"\n                }\n            ],\n            \"options\": {\n                \"checkerRequired\": false,\n                \"membersEnabled\": false\n            }\n        },\n        \"submission\": {\n            \"documentTemplate\": null,\n            \"signatureEnabled\": false\n        },\n        \"welcomeScreen\": {\n            \"disclaimerText\": \"\",\n            \"enabled\": false\n        },\n        \"active\": true,\n        \"defaultManager\": null,\n        \"removed\": false,\n        \"type\": \"individual\",\n        \"created\": \"2020-03-30T11:34:46.345Z\",\n        \"history\": [\n            {\n                \"_id\": \"5e81d956f52e300013c7e5bf\",\n                \"event\": \"create\",\n                \"user\": \"5d25a03ff784627fe5b96918\",\n                \"timestamp\": \"2020-03-30T11:34:46.365Z\"\n            },\n            {\n                \"_id\": \"5e81d9d6f52e300013c7e5c5\",\n                \"event\": \"add_requirement\",\n                \"user\": \"5d25a03ff784627fe5b96918\",\n                \"timestamp\": \"2020-03-30T11:36:54.789Z\"\n            },\n            {\n                \"_id\": \"5e81d9e4f52e300013c7e5c7\",\n                \"event\": \"edit\",\n                \"user\": \"5d25a03ff784627fe5b96918\",\n                \"timestamp\": \"2020-03-30T11:37:08.862Z\"\n            },\n            {\n                \"_id\": \"5e81d9f3f52e300013c7e5c8\",\n                \"event\": \"edit\",\n                \"user\": \"5d25a03ff784627fe5b96918\",\n                \"timestamp\": \"2020-03-30T11:37:23.706Z\"\n            }\n        ],\n        \"legalLinks\": [],\n        \"memberTemplates\": [\n            {\n                \"isDefault\": true,\n                \"legalEntityTypes\": [],\n                \"memberRoles\": [\n                    \"director_ltd\",\n                    \"shareholder\",\n                    \"ubo\",\n                    \"observer\",\n                    \"authorizedSignatory\",\n                    \"other\",\n                    \"manager\",\n                    \"member_llc\",\n                    \"other_llc\",\n                    \"grantor\",\n                    \"beneficiary_tst\",\n                    \"trustee\",\n                    \"protector\",\n                    \"founder\",\n                    \"director_fnd\",\n                    \"supervisor\",\n                    \"beneficiary_fnd\",\n                    \"generalPartner\",\n                    \"limitedPartner\",\n                    \"member\"\n                ],\n                \"_id\": \"5e81d956f52e300013c7e5c0\",\n                \"memberType\": \"individual\",\n                \"template\": null\n            }\n        ],\n        \"name\": \"selfkey test\",\n        \"description\": \"selfkey test\",\n        \"scope\": \"608f1f77bcf86cd799438011\"\n    },\n    \"managers\": [\n        {\n            \"_id\": \"5e8c782aa88e7b00139f589f\",\n            \"role\": \"manager\",\n            \"user\": \"5d25a03ff784627fe5b96918\",\n            \"id\": \"5e8c782aa88e7b00139f589f\"\n        }\n    ],\n    \"members\": [],\n    \"statusLog\": [\n        {\n            \"_id\": \"5e8c9eab957ad100130d4201\",\n            \"timestamp\": \"2020-04-07T15:39:23.359Z\",\n            \"code\": 9,\n            \"note\": null,\n            \"user\": null,\n            \"id\": \"5e8c9eab957ad100130d4201\"\n        },\n        {\n            \"_id\": \"5e8c9eab957ad100130d41ff\",\n            \"timestamp\": \"2020-04-07T15:39:23.078Z\",\n            \"code\": 16,\n            \"id\": \"5e8c9eab957ad100130d41ff\"\n        },\n        {\n            \"_id\": \"5e8c9bdba88e7b00139f5903\",\n            \"timestamp\": \"2020-04-07T15:27:23.291Z\",\n            \"code\": 2,\n            \"id\": \"5e8c9bdba88e7b00139f5903\"\n        },\n        {\n            \"_id\": \"5e8c957ca88e7b00139f5901\",\n            \"timestamp\": \"2020-04-07T15:00:12.666Z\",\n            \"code\": 9,\n            \"note\": null,\n            \"user\": null,\n            \"id\": \"5e8c957ca88e7b00139f5901\"\n        },\n        {\n            \"_id\": \"5e8c957ca88e7b00139f58ff\",\n            \"timestamp\": \"2020-04-07T15:00:12.623Z\",\n            \"code\": 16,\n            \"id\": \"5e8c957ca88e7b00139f58ff\"\n        },\n        {\n            \"_id\": \"5e8c9531a88e7b00139f58fd\",\n            \"timestamp\": \"2020-04-07T14:58:57.525Z\",\n            \"code\": 2,\n            \"id\": \"5e8c9531a88e7b00139f58fd\"\n        },\n        {\n            \"_id\": \"5e8c9437a88e7b00139f58fb\",\n            \"timestamp\": \"2020-04-07T14:54:47.066Z\",\n            \"code\": 9,\n            \"note\": null,\n            \"user\": null,\n            \"id\": \"5e8c9437a88e7b00139f58fb\"\n        },\n        {\n            \"_id\": \"5e8c9437a88e7b00139f58f9\",\n            \"timestamp\": \"2020-04-07T14:54:47.010Z\",\n            \"code\": 16,\n            \"id\": \"5e8c9437a88e7b00139f58f9\"\n        },\n        {\n            \"_id\": \"5e8c9325a88e7b00139f58f7\",\n            \"timestamp\": \"2020-04-07T14:50:13.783Z\",\n            \"code\": 2,\n            \"id\": \"5e8c9325a88e7b00139f58f7\"\n        },\n        {\n            \"_id\": \"5e8c9308a88e7b00139f58f5\",\n            \"timestamp\": \"2020-04-07T14:49:44.686Z\",\n            \"code\": 9,\n            \"note\": null,\n            \"user\": null,\n            \"id\": \"5e8c9308a88e7b00139f58f5\"\n        },\n        {\n            \"_id\": \"5e8c9308a88e7b00139f58f3\",\n            \"timestamp\": \"2020-04-07T14:49:44.664Z\",\n            \"code\": 16,\n            \"id\": \"5e8c9308a88e7b00139f58f3\"\n        },\n        {\n            \"_id\": \"5e8c92d1a88e7b00139f58f1\",\n            \"timestamp\": \"2020-04-07T14:48:49.088Z\",\n            \"code\": 2,\n            \"id\": \"5e8c92d1a88e7b00139f58f1\"\n        },\n        {\n            \"_id\": \"5e8c9285a88e7b00139f58ef\",\n            \"timestamp\": \"2020-04-07T14:47:33.484Z\",\n            \"code\": 9,\n            \"note\": null,\n            \"user\": null,\n            \"id\": \"5e8c9285a88e7b00139f58ef\"\n        },\n        {\n            \"_id\": \"5e8c9285a88e7b00139f58ec\",\n            \"timestamp\": \"2020-04-07T14:47:33.437Z\",\n            \"code\": 16,\n            \"note\": {\n                \"_id\": \"5e8c9285a88e7b00139f58eb\",\n                \"external\": false,\n                \"content\": \"application reopened\",\n                \"owner\": \"5d25a03ff784627fe5b96918\",\n                \"createdAt\": \"2020-04-07T14:47:33.428Z\"\n            },\n            \"id\": \"5e8c9285a88e7b00139f58ec\"\n        },\n        {\n            \"_id\": \"5e8c89bfa88e7b00139f58e8\",\n            \"timestamp\": \"2020-04-07T14:10:07.977Z\",\n            \"code\": 2,\n            \"note\": {\n                \"_id\": \"5e8c89bfa88e7b00139f58e7\",\n                \"external\": false,\n                \"content\": \"I am approving this application\",\n                \"owner\": \"5d25a03ff784627fe5b96918\",\n                \"createdAt\": \"2020-04-07T14:10:07.975Z\"\n            },\n            \"id\": \"5e8c89bfa88e7b00139f58e8\"\n        },\n        {\n            \"_id\": \"5e8c8991a88e7b00139f58e5\",\n            \"timestamp\": \"2020-04-07T14:09:21.615Z\",\n            \"code\": 9,\n            \"note\": null,\n            \"user\": null,\n            \"id\": \"5e8c8991a88e7b00139f58e5\"\n        },\n        {\n            \"_id\": \"5e8c8991a88e7b00139f58e2\",\n            \"timestamp\": \"2020-04-07T14:09:21.596Z\",\n            \"code\": 16,\n            \"note\": {\n                \"_id\": \"5e8c8991a88e7b00139f58e1\",\n                \"external\": false,\n                \"content\": \"application reopened\",\n                \"owner\": \"5d25a03ff784627fe5b96918\",\n                \"createdAt\": \"2020-04-07T14:09:21.594Z\"\n            },\n            \"id\": \"5e8c8991a88e7b00139f58e2\"\n        },\n        {\n            \"_id\": \"5e8c8851a88e7b00139f58de\",\n            \"timestamp\": \"2020-04-07T14:04:01.787Z\",\n            \"code\": 2,\n            \"note\": {\n                \"_id\": \"5e8c8851a88e7b00139f58dd\",\n                \"external\": false,\n                \"content\": \"I am approving this application\",\n                \"owner\": \"5d25a03ff784627fe5b96918\",\n                \"createdAt\": \"2020-04-07T14:04:01.784Z\"\n            },\n            \"id\": \"5e8c8851a88e7b00139f58de\"\n        },\n        {\n            \"_id\": \"5e8c8632a88e7b00139f58db\",\n            \"timestamp\": \"2020-04-07T13:54:58.285Z\",\n            \"code\": 9,\n            \"note\": null,\n            \"user\": null,\n            \"id\": \"5e8c8632a88e7b00139f58db\"\n        },\n        {\n            \"_id\": \"5e8c8632a88e7b00139f58d8\",\n            \"timestamp\": \"2020-04-07T13:54:58.268Z\",\n            \"code\": 16,\n            \"note\": {\n                \"_id\": \"5e8c8632a88e7b00139f58d7\",\n                \"external\": false,\n                \"content\": \"application reopened\",\n                \"owner\": \"5d25a03ff784627fe5b96918\",\n                \"createdAt\": \"2020-04-07T13:54:58.266Z\"\n            },\n            \"id\": \"5e8c8632a88e7b00139f58d8\"\n        },\n        {\n            \"_id\": \"5e8c85c2a88e7b00139f58d4\",\n            \"timestamp\": \"2020-04-07T13:53:06.752Z\",\n            \"code\": 2,\n            \"note\": {\n                \"_id\": \"5e8c85c2a88e7b00139f58d2\",\n                \"external\": false,\n                \"content\": \"I am approving this application\",\n                \"owner\": \"5d25a03ff784627fe5b96918\",\n                \"createdAt\": \"2020-04-07T13:53:06.748Z\"\n            },\n            \"id\": \"5e8c85c2a88e7b00139f58d4\"\n        },\n        {\n            \"_id\": \"5e8c78c3a88e7b00139f58cb\",\n            \"timestamp\": \"2020-04-07T12:57:39.575Z\",\n            \"code\": 9,\n            \"id\": \"5e8c78c3a88e7b00139f58cb\"\n        },\n        {\n            \"_id\": \"5e8c78b9a88e7b00139f58c9\",\n            \"timestamp\": \"2020-04-07T12:57:29.009Z\",\n            \"code\": 9,\n            \"note\": null,\n            \"user\": null,\n            \"id\": \"5e8c78b9a88e7b00139f58c9\"\n        },\n        {\n            \"_id\": \"5e8c78b8a88e7b00139f58c6\",\n            \"timestamp\": \"2020-04-07T12:57:28.975Z\",\n            \"code\": 16,\n            \"id\": \"5e8c78b8a88e7b00139f58c6\"\n        },\n        {\n            \"_id\": \"5e8c78aea88e7b00139f58c2\",\n            \"timestamp\": \"2020-04-07T12:57:18.483Z\",\n            \"code\": 3,\n            \"id\": \"5e8c78aea88e7b00139f58c2\"\n        },\n        {\n            \"_id\": \"5e8c78a9a88e7b00139f58bf\",\n            \"timestamp\": \"2020-04-07T12:57:13.451Z\",\n            \"code\": 9,\n            \"note\": null,\n            \"user\": null,\n            \"id\": \"5e8c78a9a88e7b00139f58bf\"\n        },\n        {\n            \"_id\": \"5e8c78a9a88e7b00139f58bc\",\n            \"timestamp\": \"2020-04-07T12:57:13.431Z\",\n            \"code\": 16,\n            \"id\": \"5e8c78a9a88e7b00139f58bc\"\n        },\n        {\n            \"_id\": \"5e8c78a2a88e7b00139f58b8\",\n            \"timestamp\": \"2020-04-07T12:57:06.638Z\",\n            \"code\": 2,\n            \"id\": \"5e8c78a2a88e7b00139f58b8\"\n        },\n        {\n            \"_id\": \"5e8c7890a88e7b00139f58b5\",\n            \"timestamp\": \"2020-04-07T12:56:48.980Z\",\n            \"code\": 9,\n            \"id\": \"5e8c7890a88e7b00139f58b5\"\n        },\n        {\n            \"_id\": \"5e8c7868a88e7b00139f58b0\",\n            \"timestamp\": \"2020-04-07T12:56:08.879Z\",\n            \"code\": 4,\n            \"id\": \"5e8c7868a88e7b00139f58b0\"\n        },\n        {\n            \"_id\": \"5e8c7840a88e7b00139f58ab\",\n            \"timestamp\": \"2020-04-07T12:55:28.902Z\",\n            \"code\": 11,\n            \"id\": \"5e8c7840a88e7b00139f58ab\"\n        },\n        {\n            \"_id\": \"5e8c783ca88e7b00139f58aa\",\n            \"timestamp\": \"2020-04-07T12:55:24.543Z\",\n            \"code\": 6,\n            \"id\": \"5e8c783ca88e7b00139f58aa\"\n        },\n        {\n            \"_id\": \"5e8c782aa88e7b00139f58a0\",\n            \"timestamp\": \"2020-04-07T12:55:06.077Z\",\n            \"code\": 14,\n            \"id\": \"5e8c782aa88e7b00139f58a0\"\n        },\n        {\n            \"_id\": \"5e8c782aa88e7b00139f589e\",\n            \"timestamp\": \"2020-04-07T12:55:06.074Z\",\n            \"code\": 5,\n            \"id\": \"5e8c782aa88e7b00139f589e\"\n        }\n    ],\n    \"baseApplicationId\": \"5e8c782aa88e7b00139f589d\",\n    \"createdAt\": \"2020-04-07T12:55:06.146Z\",\n    \"updatedAt\": \"2020-04-07T15:39:23.369Z\",\n    \"currentStatus\": 9,\n    \"id\": \"5e8c782aa88e7b00139f589d\",\n    \"statusName\": \"In Progress\"\n}\n```\n\n### Update application status\n\nYou can manage the application status via the following request:\n\n##### Node.js\n\n```js\nawait client.applications.changeStatus(\n    applicationId,\n    client.statuses.APPROVED\n);\n```\n##### HTTP\n\n```bash\nPOST \u003cKYCC_API_KEY\u003e/integrations/v2/applications/\u003cAPPLICATION_ID\u003e/status_changes\n\nHEADERS:\napiKey: \u003cKYCC_API_URL\u003e\nContent-Type: application/json\n\nBODY:\n{\n    \"code\": 2\n}\n\n```\n\nExample: [routes/index.js](https://github.com/SelfKeyFoundation/relying-party-mp-kycc-demo/blob/master/src/routes/index.js)\n\n### Working with personal information\n\nKYC-Chain api application is constructed from 2 sets of personal information\n\n- Identity attributes\n- Questions\n\n#### Identity Attributes\n\nIdentity Attribute is a predefined atomic peace of information about a person. Attributes are defined with JSON Schema.\n\nHere is the full list of currently supported identity attributes: [https://platform.selfkey.org/repository.json](https://platform.selfkey.org/repository.json)\n\nYou can also load a fully resolved list from here: [https://platform.selfkey.org/resolved-repository.json](https://platform.selfkey.org/resolved-repository.json)\n\n##### Invalidate an Attribute\n\nWhile the manager is checking the application, he can decide to invalidate an identity attribute (request to fill again).\nHere is how to do it via the API\n\n##### Node.js\n\n```js\nconst attributesToInvalidate = [\"5e81d956f52e300013c7e5c2\", \"5e81d956f52e300013c7e5c3\"]\nconst response = await kyccClient.applications.attributes.invalidate(applicationId, attributesToInvalidate);\n```\n\n##### HTTP\n\n```bash\nPOST \u003cKYCC_API_KEY\u003e/integrations/v2/applications/\u003cAPPLICATION_ID\u003e/attributes/invalidate?attributes[]=5e81d956f52e300013c7e5c2\u0026attributes[]=5e81d956f52e300013c7e5c3\n\nHEADERS:\napiKey: \u003cKYCC_API_URL\u003e\n```\n\nThis operation will cause the `valid` field of the attributes to become `false`\n\n```js\n[\n    ...,\n    \"5e81d956f52e300013c7e5c2\": {\n        \"description\": \"First name\",\n        \"isAdditional\": false,\n        \"label\": \"First name\",\n        \"optional\": false,\n        \"schema\": \"http://platform.selfkey.org/schema/attribute/first-name.json\",\n        \"valid\": false,\n        \"value\": \"Test\"\n    },\n    \"5e81d956f52e300013c7e5c3\": {\n        \"description\": \"Middle name\",\n        \"isAdditional\": false,\n        \"label\": \"Middle name\",\n        \"optional\": true,\n        \"schema\": \"http://platform.selfkey.org/schema/attribute/middle-name.json\",\n        \"valid\": false,\n        \"value\": \"test\"\n    },\n    ...\n```\n\n##### Request Additional Attribute\n\nWhile the manager is checking the application, he can decide to request additional attributes from the customer\nHere is how to do it via the API\n\n##### Node.js\n\n```js\nconst additionalAttribute = {\n    \"description\": \"Please insert an image of your fingerpring\",\n    \"label\": \"Fingerprint\",\n    \"optional\": false,\n    \"schema\": \"http://platform.selfkey.org/schema/attribute/fingerprint.json\"\n}\nconst response = await kyccClient.applications.attributes.add(applicationId, additionalAttribute);\n```\n\n##### HTTP\n\n```bash\nPOST \u003cKYCC_API_KEY\u003e/integrations/v2/applications/\u003cAPPLICATION_ID\u003e/attributes\n\nHEADERS:\napiKey: \u003cKYCC_API_URL\u003e\nContent-Type: application/json\n\nBODY:\n{\n    \"description\": \"Please insert an image of your fingerpring\",\n    \"label\": \"Fingerprint\",\n    \"optional\": false,\n    \"schema\": \"http://platform.selfkey.org/schema/attribute/fingerprint.json\"\n}\n```\n\nThis operation will add a new attribute to fill in the application and it will contain a new field `isAdditional: true`\n\n```js\n[\n    ...,\n    \"5e8de186957ad100130d426f\": {\n        \"description\": \"Please insert an image of your fingerpring\",\n        \"label\": \"Fingerprint\",\n        \"optional\": false,\n        \"schema\": \"http://platform.selfkey.org/schema/attribute/fingerprint.json\"\n        \"valid\": false,\n        \"isAdditional\": true\n    }\n```\n\n#### Questions\n\nBesides Identity Attributes KYC-Chain supports general questions to be requested of the customer. Thous are generic text questions and don't have a predefined schema.\n\n##### Invalidate a Question\n\nWhile the manager is checking the application, he can decide to invalidate the answer to a question (request to answer again).\nHere is how to do it via the API\n\n##### Node.js\n\n```js\nconst questionsToInvalidate = [\"5e81d956f52e300013c7e5c2\", \"5e81d956f52e300013c7e5c3\"]\nconst response = await kyccClient.applications.questions.invalidate(applicationId, questionsToInvalidate);\n```\n\n##### HTTP\n\n```bash\nPOST \u003cKYCC_API_KEY\u003e/integrations/v2/applications/\u003cAPPLICATION_ID\u003e/questions/invalidate?questions[]=5e81d956f52e300013c7e5c2\u0026questions[]=5e81d956f52e300013c7e5c3\n\nHEADERS:\napiKey: \u003cKYCC_API_URL\u003e\n```\n\nThis operation will cause the `valid` field of the question to become `false`\n\n```js\n[\n    ...,\n    \"5e81d956f52e300013c7e5c2\": {\n        \"description\": \"First name\",\n        \"isAdditional\": false,\n        \"label\": \"First name\",\n        \"optional\": false,\n        \"question\": \"What is your Given Name?\"\n        \"valid\": false,\n        \"value\": \"Test\",\n        \"type\": \"input\"˝\n    },\n    \"5e81d956f52e300013c7e5c3\": {\n        \"description\": \"Middle name\",\n        \"isAdditional\": false,\n        \"label\": \"Middle name\",\n        \"optional\": true,\n        \"question\": \"What is your Middle Name?\"\n        \"valid\": false,\n        \"value\": \"test\",\n        \"type\": \"input\"\n    },\n    ...\n```\n\n##### Request to Answer Additional Questions\n\nWhile the manager is checking the application, he can decide to request answers for additional questions from the customer\nHere is how to do it via the API\n\n##### Node.js\n\n```js\nconst additionalQuestion = {\n    \"description\": \"How many fingers on the hand\",\n    \"label\": \"Fingers on the Hand\",\n    \"optional\": false,\n    \"questions\": \"How many fingers do you have on your right hand?\",\n    \"type\": \"select\",\n    \"options\": [\"10\", \"20\", \"5\", \"6\"]\n}\nconst response = await kyccClient.applications.questions.add(applicationId, additionalQuestion);\n```\n\n##### HTTP\n\n```bash\nPOST \u003cKYCC_API_KEY\u003e/integrations/v2/applications/\u003cAPPLICATION_ID\u003e/questions\n\nHEADERS:\napiKey: \u003cKYCC_API_URL\u003e\nContent-Type: application/json\n\nBODY:\n{\n    \"description\": \"How many fingers on the hand\",\n    \"label\": \"Fingers on the Hand\",\n    \"optional\": false,\n    \"questions\": \"How many fingers do you have on your right hand?\",\n    \"type\": \"select\",\n    \"options\": [\"10\", \"20\", \"5\", \"6\"]\n}\n```\n\nThis operation will add a new question to fill in the application and it will contain a new field `isAdditional: true`\n\n```js\n[\n    ...,\n    \"5e8de186957ad100130d426f\": {\n        \"description\": \"How many fingers on the hand\",\n        \"label\": \"Fingers on the Hand\",\n        \"optional\": false,\n        \"questions\": \"How many fingers do you have on your right hand?\",\n        \"type\": \"select\",\n        \"options\": [\"10\", \"20\", \"5\", \"6\"],\n        \"isAdditional\": true\n    }\n```\n\n\u003ca name=\"license\"\u003e\u003c/a\u003e\n\n## License\n\n[The GPL-3.0 License](http://opensource.org/licenses/GPL-3.0)\n\nCopyright (c) 2018 SelfKey Foundation \u003chttps://selfkey.org/\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselfkeyfoundation%2Frelying-party-mp-kycc-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fselfkeyfoundation%2Frelying-party-mp-kycc-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselfkeyfoundation%2Frelying-party-mp-kycc-demo/lists"}