Evidence

People are a core part of the Checkmate system - the very reason Checkmate exists is so you can securely view, share and edit personal identity documents. On this page, we'll dive into the fields available on the Person model and how you can use them to create entities programatically.

The evidence model

The person model contains all the information about an individual, such as their legal identity, address, contact information and bank accounts. Each structure is individually encrypted, allowing fine-grained access and sharing. Many of the fields applicable to people are also applicable to companies, (e.g bank accounts). For details on these models you can refer to their individual docs.

Document properties

  • Name
    file
    Type
    File | Blob | ArrayBuffer
    Description

    The raw document to attach

  • Name
    type
    Type
    DocumentType
    Description

    The type of document being uploaded

    • Passport
    • BankStatement
  • Name
    details
    Type
    DocumentDetails
    Description

    Basic information about the documents validity

    • Name
      documentNumber
      Type
      string
      Description

      Unique reference number on the document

    • Name
      issuanceDate
      Type
      string
      Optional
      Optional
      Description

      Date the document was issued, as an ISO 8601 date

    • Name
      expirationDate
      Type
      string
      Optional
      Optional
      Description

      Date the document expires, as an ISO 8601 date

  • Name
    metadata
    Type
    FileMetadata
    Description

    Metadata about the underlying file. This will be generated automatically when calling Document.create().

    • Name
      size
      Type
      integer
      Description

      File size in bytes

    • Name
      name
      Type
      string
      Description

      Original document filename

    • Name
      mimeType
      Type
      string
      Description

      Media type indicating the format of the document

      File typeValue
      PDF document (.pdf)application/pdf
      Microsoft Word (.doc, .docx)application/msword
      application/vnd.openxmlformats-officedocument.wordprocessingml.document
      Microsoft PowerPoint (.ppt, .pptx)application/vnd.ms-powerpoint
      application/vnd.openxmlformats-officedocument.presentationml.presentation
      Microsoft Excel (.xls, .xlsx)application/vnd.ms-excel
      application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
      PNG Imageimage/png
      JPG Imageimage/jpeg
      Plain texttext/plain
      CSVtext/csv
  • Name
    uri
    Type
    string
    Optional
    Optional
    Description

    IPFS URI of the document file. This will be set automatically when the document is uploaded.

  • Name
    thumbnailUri
    Type
    string
    Optional
    Optional
    Description

    IPFS URI of the document thumbnail file. This will be set automatically when the document is uploaded.

Creating evidence from a document

Create a new evidence record for a file in memory. This method automatically generates metadata attributes, but won't upload the file. Uploading is handled automatically when a claim using this evidence is encrypted and uploaded.

import { Evidence, DocumentType } from '@checkmateid/sdk'

const passport = await Evidence.Document.create({
  file,
  type: DocumentType.Passport,
  details: {
    documentNumber: '12345678',
    issuanceDate: '2010-01-01',
    expirationDate: '2017-01-01',
  }
})

Updating evidence document

You can update the file by calling update(), which supports the same options and will merge detail changes. This calculates the new file metadata and stages the changes for the next time the entity is saved.

await passport.update({
  file: newFile,
  details: {
    documentNumber: '87654321',
    issuanceDate: '2017-01-01',
    expirationDate: '2024-01-01',
  }
})

Document.create()

This endpoint allows you to retrieve a paginated list of all your contacts. By default, a maximum of ten contacts are shown per page.

Properties

  • Name
    file
    Type
    File | Blob | ArrayBuffer
    Description

    The raw document to attach

  • Name
    type
    Type
    DocumentType
    Description

    The type of document being uploaded

    • Passport
    • BankStatement
  • Name
    details
    Type
    DocumentDetails
    Description

    Basic information about the documents validity

    • Name
      documentNumber
      Type
      string
      Description

      Unique reference number on the document

    • Name
      issuanceDate
      Type
      string
      Optional
      Optional
      Description

      Date the document was issued, as an ISO 8601 date

    • Name
      expirationDate
      Type
      string
      Optional
      Optional
      Description

      Date the document expires, as an ISO 8601 date

Usage

import { Evidence, DocumentType } from '@checkmateid/sdk'

const passport = await Evidence.Document.create({
  file,
  type: DocumentType.Passport,
  details: {
    documentNumber: '12345678',
    issuanceDate: '2010-01-01',
    expirationDate: '2017-01-01',
  }
})

Was this page helpful?