Document types

These events are emitted by the Inventory API (btrz-api-inventory) when document types are created, updated, or deleted.

Events

Action Event name Endpoint
Create a document type documenttypes.created POST /document-types
Update a document type documenttypes.updated PUT /document-types/:documenttypeId
Delete a document type documenttypes.deleted DELETE /document-types/:documenttypeId

Payload example created

{
  "attemptId": "9287826c-04d1-46ab-acc8-4f49e73d160d",
  "created": 1623794394,
  "data": {
    "_id": "5ff377bbd383cf7df687fedc",
    "accountId": "52a377ec430c7d4e220001fc",
    "name": "Passport",
    "code": 12,
    "ord": 100,
    "lexiconKeys": {
      "name": {
        "key": "documenttype-name-5f243d100617680712e78dd7-fce3e1bc-983b-4b3a-a5e7-b03c0f3b63e8",
        "values": { "en-us": "Passport" }
      }
    },
    "validation": "^(?!^0+$)[a-zA-Z0-9]{3,20}$",
    "checkInReaderMapping": ["PASSPORT"],
    "createdBy": "55fc2f318791db6e1a0000b6",
    "updatedBy": "55fc2f318791db6e1a0000b6",
    "createdAt": { "offset": 0, "value": "2021-01-04T20:16:59.548Z" },
    "updatedAt": { "offset": 0, "value": "2021-01-04T20:16:59.548Z" }
  },
  "event": "documenttypes.created",
  "id": "f7cf105e-e83d-4986-8171-70ba5c6c57cd",
  "livemode": true
}

Field descriptions — data (documenttypes.created / documenttypes.updated)

Field Type Description
_id string Document type id (24 hex characters).
accountId string Account (provider) id.
name string Default name of the document type.
code number Code that identifies the document type.
ord number Display order.
lexiconKeys object Lexicon keys for the name property (key and values per language).
validation string Regex used for document type validation.
checkInReaderMapping array Options mapped from the reader to this document type (e.g. PASSPORT, SHORTVISA).
createdBy string User id that created this resource (24 hex).
updatedBy string User id that last updated this resource (24 hex).
createdAt object BzDate: date the object was created.
updatedAt object BzDate: date the object was last updated.

Payload example updated

{
  "attemptId": "43489008-c98f-4711-beb8-362b4026f0fa",
  "created": 1628024836,
  "data": {
    "_id": "5ff377bbd383cf7df687fedc",
    "accountId": "52a377ec430c7d4e220001fc",
    "name": "Passport",
    "code": 12,
    "ord": 100,
    "lexiconKeys": { "name": { "key": "documenttype-name-...", "values": { "en-us": "Passport" } } },
    "createdBy": "55fc2f318791db6e1a0000b6",
    "updatedBy": "55fc2f318791db6e1a0000b6",
    "createdAt": { "offset": 0, "value": "2021-01-04T20:16:59.548Z" },
    "updatedAt": { "offset": 0, "value": "2021-08-03T21:06:32.034Z" }
  },
  "event": "documenttypes.updated",
  "id": "24b4fd63-c0ba-4732-9aef-d379cfc81d4f",
  "livemode": true
}

(Field descriptions for data are the same as for documenttypes.created above.)

Payload example deleted

{
  "attemptId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "created": 1628024900,
  "data": {
    "documenttypeId": "5ff377bbd383cf7df687fedc"
  },
  "event": "documenttypes.deleted",
  "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
  "livemode": true
}

Field descriptions — data (documenttypes.deleted)

Field Type Description
documenttypeId string Id of the deleted document type (24 hex characters).