Download OpenAPI specification:Download
The Social Registry interoperability APIs describes different APIs some of them are usecase specific and other are generalized APIs to perform interoperable operations between social registry and SPMIS. You can now help us improve the API whether it's by making changes to the definition itself or to the code. That way, with time, we can improve the API in general, and expose some of the new features in upcoming version.
Gitbook reference link :
Code directory links:
Each request is build up of three parts
Information about each part is given below
Signature:
Header:
Message:
The async search api will accept request and will send response to on-search endpoint. The SR will implement /registry/search endpoint and the SPMIS shall implement /registry/on-search to receive data from SR. The search request message consist of reg_event_type, query_type, query, sort, pagination, consent, authorize, locale. The SR will validate the request and will send response to on-search endpoint. Information for each field is given below.
signature | string (MsgSignature) Signature of {header}+{message} body verified using sender's signing public key |
required | object Message header |
required | SearchRequest (object) or EncryptedMessage (object) The search data using which registry search to be performed |
{- "signature": "Signature: namespace=\"g2p\", kidId=\"{sender_id}|{unique_key_id}|{algorithm}\", algorithm=\"ed25519\", created=\"1606970629\", expires=\"1607030629\", headers=\"(created) (expires) digest\", signature=\"Base64(signing content)",
- "header": {
- "version": "1.0.0",
- "message_id": "123",
- "message_ts": "",
- "action": "search",
- "sender_id": "spp.example.org",
- "receiver_id": "pymts.example.org",
- "total_count": 21800,
- "is_msg_encrypted": false,
- "meta": { }
}, - "message": {
- "transaction_id": 123456789,
- "search_request": [
- {
- "reference_id": "12345678901234567890",
- "timestamp": "",
- "search_criteria": {
- "version": "1.0.0",
- "reg_event_type": "REGISTER",
- "query_type": "idtype-value",
- "query": {
- "type": "ns:org:QueryType:GraphQl",
- "value": {
- "expression": " query GeBirthRecordById: { person: (UIN: \"1\") { BRN, name, gender, birthDate, birthPlace, parents } }"
}
}, - "sort": [
- {
- "attribute_name": "YOB",
- "sort_order": "asc"
}
], - "pagination": {
- "page_size": 2000,
- "page_number": 5
}, - "consent": {
- "@type": "Consent",
- "ts": {
- "$ref": "#/components/schemas/MsgHeader_V1.0.0/properties/message_ts"
}, - "purpose": {
- "text": {
- "type": "string"
}, - "code": {
- "type": "string",
- "description": "From a fixed set, documented at refUri"
}, - "ref_uri": {
- "type": "string",
- "format": "uri",
- "description": "Uri to provide more info on consent codes"
}
}
}, - "authorize": {
- "@type": "Authorize",
- "ts": {
- "$ref": "#/components/schemas/MsgHeader_V1.0.0/properties/message_ts"
}, - "purpose": {
- "text": {
- "type": "string"
}, - "code": {
- "type": "string",
- "description": "From a fixed set, documented at refUri"
}, - "ref_uri": {
- "type": "string",
- "format": "uri",
- "description": "Uri to provide more info on authorize codes"
}
}
}
}, - "locale": "en"
}
]
}
}
{- "errors": [
- {
- "code": "string",
- "message": "string"
}
]
}
The /registry/on-search end point tobe implemented by SPMIS to receive search results from SR. The SR will send data in format explained in SearchResponse.yaml. The reg_records will containe data that in explained in social/v1/Person.jsonld. Refer example json at gitbook link.
signature | string (MsgSignature) Signature of {header}+{message} body verified using sender's signing public key |
required | object Message header |
SearchResponse (object) or EncryptedMessage (object) |
{- "signature": "Signature: namespace=\"g2p\", kidId=\"{sender_id}|{unique_key_id}|{algorithm}\", algorithm=\"ed25519\", created=\"1606970629\", expires=\"1607030629\", headers=\"(created) (expires) digest\", signature=\"Base64(signing content)",
- "header": {
- "version": "1.0.0",
- "message_id": "789",
- "message_ts": "",
- "action": "on-search",
- "status": "rcvd",
- "status_reason_code": "rjct.version.invalid",
- "status_reason_message": "string",
- "total_count": 21800,
- "completed_count": 50,
- "sender_id": "civilregistry.example.org",
- "receiver_id": "registry.example.org",
- "is_msg_encrypted": false,
- "meta": { }
}, - "message": {
- "transaction_id": 123456789,
- "correlation_id": "9876543210",
- "search_response": [
- {
- "reference_id": "12345678901234567890",
- "timestamp": "",
- "status": "rcvd",
- "status_reason_code": "rjct.reference_id.invalid",
- "status_reason_message": "string",
- "data": {
- "version": "1.0.0",
- "reg_records": [
- {
- "@context": {
}, - "@id": "Person",
- "@type": "Person",
- "identifier": {
- "@id": "Identifier",
- "@type": "Identifier",
- "identifier_type": "UIN",
- "identifier_value": "847951632"
}, - "name": {
- "@type": "Name",
- "surname": "Phumchai",
- "given_name": "Sudarat",
- "second_name": "",
- "prefix": "Dr.",
- "suffix": "PhD"
}, - "birth_date": "1995-09-21T11:20:00",
- "sex": "female",
- "marital_status": "M",
- "is_disabled": 2,
- "disability_identifier": {
- "@id": "Identifier",
- "@type": "Identifier",
- "identifier_type": "UIN",
- "identifier_value": "753869421"
}, - "disability_type": "",
- "functional_limitation_type": "d132",
- "functional_severity": "0",
- "nationality": "ISO 3166-2:DZ",
- "employment_status": "1",
- "is_deceased": "2",
- "death_date": "",
- "ethnicity": "",
- "address": {
- "@id": "Address_1",
- "@type": "Address",
- "address_line1": "Bophut Koh Samui",
- "address_line2": "Surat, Near Big Buddha Beach",
- "locality": "Thani",
- "sub_region_code": "SH",
- "region_code": "A205",
- "postal_code": "84320",
- "country_code": "TH",
- "geo_location": {
- "@id": "GeoLocation_1",
- "@type": "GeoLocation",
- "plus_code": {
- "global_code": "8FW4V900+",
- "geometry": {
- "@id": "geometry",
- "@type": "GeoLocation",
- "bounds": {
- "@id": "bounds",
- "@type": "geometry",
- "northeast": {
- "@id": "northeast",
- "@type": "GeoCoordinates",
- "latitude": 48.900000000000006,
- "longitude": 2.4000000000000057
}, - "southwest": {
- "@id": "southwest",
- "@type": "GeoCoordinates",
- "latitude": 48.849999999999994,
- "longitude": 2.3499999999999943
}
}, - "location": {
- "@id": "location",
- "@type": "GeoCoordinates",
- "latitude": 48.875,
- "longitude": 2.375
}
}
}
}
}, - "phone_number": "+66891234567",
- "email": "sudarat.phumchai@example.com",
- "household_identifier": "",
- "household_status": "1",
- "poverty_score": "2.5",
- "parent1_identifier": {
- "@id": "Identifier",
- "@type": "Identifier",
- "identifier_type": "UIN",
- "identifier_value": "753869421"
}, - "parent2_identifier": {
- "@id": "Identifier",
- "@type": "Identifier",
- "identifier_type": "UIN",
- "identifier_value": "852963741"
}, - "registration_date": "2022-09-21T11:20:00",
- "last_updated": "2022-09-21T11:20:00"
}
]
}, - "pagination": {
- "page_size": 2000,
- "page_number": 5,
- "total_count": 24250
}, - "locale": "en"
}
]
}
}
{- "errors": [
- {
- "code": "string",
- "message": "string"
}
]
}
The /registry/subscribe end point tobe implemented by SR to receive subscription request from SPMIS. The subscription request contain event type, frequency and query information, based on that resistry will send notification to subscriber.
signature | string (MsgSignature) Signature of {header}+{message} body verified using sender's signing public key |
required | object Message header |
required | SubscribeRequest (object) or EncryptedMessage (object) Subscription request which contaion query with frequency and other info on which notification to be sent by registry to subscriber, The IBR supports benefit_disbusrement,programme_exited events as of now |
{- "signature": "Signature: namespace=\"g2p\", kidId=\"{sender_id}|{unique_key_id}|{algorithm}\", algorithm=\"ed25519\", created=\"1606970629\", expires=\"1607030629\", headers=\"(created) (expires) digest\", signature=\"Base64(signing content)",
- "header": {
- "version": "1.0.0",
- "message_id": "123",
- "message_ts": "",
- "action": "subscribe",
- "sender_id": "spp.example.org",
- "receiver_id": "pymts.example.org",
- "total_count": 21800,
- "is_msg_encrypted": false,
- "meta": { }
}, - "message": {
- "transaction_id": 123456789,
- "subscribe_request": [
- {
- "reference_id": "12345678901234567890",
- "timestamp": "",
- "subscribe_criteria": {
- "version": "1.0.0",
- "reg_type": "ns:org:RegistryType:IBR",
- "reg_event_type": "REGISTER",
- "frequency": {
- "start_time": "",
- "end_time": "",
- "frequency": "string"
}, - "filter_type": "idtype-value",
- "filter": {
- "type": "ns:org:QueryType:GraphQl",
- "value": {
- "expression": " query GeBirthRecordById: { person: (UIN: \"1\") { BRN, name, gender, birthDate, birthPlace, parents } }"
}
}, - "notify_record_type": "Person",
- "authorize": {
- "@type": "Authorize",
- "ts": {
- "$ref": "#/components/schemas/MsgHeader_V1.0.0/properties/message_ts"
}, - "purpose": {
- "text": {
- "type": "string"
}, - "code": {
- "type": "string",
- "description": "From a fixed set, documented at refUri"
}, - "ref_uri": {
- "type": "string",
- "format": "uri",
- "description": "Uri to provide more info on authorize codes"
}
}
}
}, - "locale": "en"
}
]
}
}
{- "errors": [
- {
- "code": "string",
- "message": "string"
}
]
}
The /registry/on-subscribe request tobe implemented by SPMIS to receive subscription response from SR. The response with contain subscription code which to be used to unsubscribe the subscription or to track subscription details.
signature | string (MsgSignature) Signature of {header}+{message} body verified using sender's signing public key |
required | object Message header |
required | SubscribeResponse (object) or EncryptedMessage (object) Subscription information |
{- "signature": "Signature: namespace=\"g2p\", kidId=\"{sender_id}|{unique_key_id}|{algorithm}\", algorithm=\"ed25519\", created=\"1606970629\", expires=\"1607030629\", headers=\"(created) (expires) digest\", signature=\"Base64(signing content)",
- "header": {
- "version": "1.0.0",
- "message_id": "123",
- "message_ts": "",
- "action": "on-subscribe",
- "sender_id": "spp.example.org",
- "receiver_id": "pymts.example.org",
- "total_count": 21800,
- "is_msg_encrypted": false,
- "meta": { }
}, - "message": {
- "transaction_id": 123456789,
- "correlation_id": "9876543210",
- "subscribe_response": [
- {
- "reference_id": "12345678901234567890",
- "timestamp": "",
- "status": "rcvd",
- "status_reason_code": "rjct.reference_id.invalid",
- "status_reason_message": "string",
- "subscriptions": [
- {
- "version": "1.0.0",
- "code": "string",
- "status": "subscribe",
- "timestamp": "",
- "reg_type": "ns:org:RegistryType:Civil",
- "reg_event_type": "spdci-common:RegistryEventType:LiveBirth",
- "frequency": {
- "start_time": "",
- "end_time": "",
- "frequency": "string"
}, - "filter_type": "idtype-value",
- "filter": {
- "type": "ns:org:QueryType:GraphQl",
- "value": {
- "expression": " query GeBirthRecordById: { person: (UIN: \"1\") { BRN, name, gender, birthDate, birthPlace, parents } }"
}
}, - "notify_record_type": "spdci-extensions-dci:Person",
- "locale": "en"
}
], - "pagination": {
- "page_size": 2000,
- "page_number": 5,
- "total_count": 24250
}, - "locale": "en"
}
]
}
}
{- "errors": [
- {
- "code": "string",
- "message": "string"
}
]
}
The /registry/unsubscribe endpoint will be implemented by SR, SPMIS can send request to unsubscribe existing subscription(s) by subscription_code(s).
signature | string (MsgSignature) Signature of {header}+{message} body verified using sender's signing public key |
required | object Message header |
required | UnSubscribeRequest (object) or EncryptedMessage (object) The unsubscribe request that contain subscription ids which to be removed from subscription list |
{- "signature": "Signature: namespace=\"g2p\", kidId=\"{sender_id}|{unique_key_id}|{algorithm}\", algorithm=\"ed25519\", created=\"1606970629\", expires=\"1607030629\", headers=\"(created) (expires) digest\", signature=\"Base64(signing content)",
- "header": {
- "version": "1.0.0",
- "message_id": "123",
- "message_ts": "",
- "action": "unsubscribe",
- "sender_id": "spp.example.org",
- "receiver_id": "pymts.example.org",
- "total_count": 21800,
- "is_msg_encrypted": false,
- "meta": { }
}, - "message": {
- "transaction_id": 123456789,
- "timesstamp": "",
- "subscription_codes": [
- "string"
]
}
}
{- "errors": [
- {
- "code": "string",
- "message": "string"
}
]
}
The /registry/on-unsubscribe will be implemented by SPMIS to receive unsubscribe response from SR. It will contain status information of unsubscribe request.
signature | string (MsgSignature) Signature of {header}+{message} body verified using sender's signing public key |
required | object Message header |
required | UnSubscribeResponse (object) or EncryptedMessage (object) |
{- "signature": "Signature: namespace=\"g2p\", kidId=\"{sender_id}|{unique_key_id}|{algorithm}\", algorithm=\"ed25519\", created=\"1606970629\", expires=\"1607030629\", headers=\"(created) (expires) digest\", signature=\"Base64(signing content)",
- "header": {
- "version": "1.0.0",
- "message_id": "123",
- "message_ts": "",
- "action": "on-unsubscribe",
- "sender_id": "spp.example.org",
- "receiver_id": "pymts.example.org",
- "total_count": 21800,
- "is_msg_encrypted": false,
- "meta": { }
}, - "message": {
- "transaction_id": 123456789,
- "correlation_id": "9876543210",
- "timesatmp": "",
- "status": "rcvd",
- "status_reason_code": "rjct.reference_id.invalid",
- "status_reason_message": "string",
- "subscription_status": [
- {
- "code": "string",
- "status": "subscribe"
}
]
}
}
{- "errors": [
- {
- "code": "string",
- "message": "string"
}
]
}
The /registry/sync/notify end point will be implemented by SPMIS to receive notification for subscribed event. The notification will be sent based on subscription criteria.
signature | string (MsgSignature) Signature of {header}+{message} body verified using sender's signing public key |
required | object Message header |
NotifyEventRequest (object) or EncryptedMessage (object) |
{- "signature": "Signature: namespace=\"g2p\", kidId=\"{sender_id}|{unique_key_id}|{algorithm}\", algorithm=\"ed25519\", created=\"1606970629\", expires=\"1607030629\", headers=\"(created) (expires) digest\", signature=\"Base64(signing content)",
- "header": {
- "version": "1.0.0",
- "message_id": "789",
- "message_ts": "",
- "action": "notify",
- "status": "rcvd",
- "status_reason_code": "rjct.version.invalid",
- "status_reason_message": "string",
- "total_count": 21800,
- "completed_count": 50,
- "sender_id": "civilregistry.example.org",
- "receiver_id": "registry.example.org",
- "is_msg_encrypted": false,
- "meta": { }
}, - "message": {
- "transaction_id": 123456789,
- "notify_event": [
- {
- "reference_id": "12345678901234567890",
- "timestamp": "",
- "data": {
- "version": "1.0.0",
- "reg_type": "ns:org:RegistryType:Civil",
- "reg_event_type": "spdci-common:RegistryEventType:LiveBirth",
- "reg_record_type": "spdci-extensions-dci:Person",
- "reg_records": {
- "type": "object",
- "description": "@context: https://schema.spdci.org/CRVSPerson\" <br>\n@type: \"Consent\"\n",
- "example": {
- "@type": "CRVSPerson",
- "CRVSPerson": {
- "@type": "rdfs:Class",
- "@context": {
- "name": {
- "@id": "schema:name",
- "@type": "xsd:string"
}, - "givenName": {
- "@id": "schema:givenName",
- "@type": "xsd:string"
}, - "familyName": {
- "@id": "schema:familyName",
- "@type": "xsd:string"
}, - "additionalName": {
- "@id": "schema:additionalName",
- "@type": "xsd:string"
}, - "gender": {
- "@id": "schema:gender",
- "@type": "xsd:string"
}, - "birthDate": {
- "@id": "schema:birthDate",
- "@type": "xsd:date"
}, - "birthPlace": {
- "@id": "schema:birthPlace",
- "@type": "schema:GeoCoordinates"
}, - "deathDate": {
- "@id": "schema:deathDate",
- "@type": "xsd:date"
}, - "deathPlace": {
- "@id": "schema:deathPlace",
- "@type": "schema:GeoCoordinates"
}, - "maritalStatus": {
- "@id": "schema:maritalStatus",
- "@type": "xsd:string"
}, - "honorificPrefix": {
- "@id": "schema:honorificPrefix",
- "@type": "xsd:string"
}, - "honorificSuffix": {
- "@id": "schema:honorificSuffix",
- "@type": "xsd:string"
}, - "emails": {
- "@container": "@set",
- "@id": "schema:email",
- "@type": "xsd:string"
}, - "telephones": {
- "@container": "@set",
- "@id": "schema:telephone",
- "@type": "xsd:string"
}, - "address": {
- "@id": "schema:address",
- "@type": "schema:GeoCoordinates"
},
}
},
}
}
}, - "locale": "en"
}
]
}
}
{- "errors": [
- {
- "code": "string",
- "message": "string"
}
]
}
The /registry/on-notify will be implemented by SR to receive notification response from SPMIS.
signature | string (MsgSignature) Signature of {header}+{message} body verified using sender's signing public key |
required | object Message header |
ReceiptResponse (object) or EncryptedMessage (object) |
{- "signature": "Signature: namespace=\"g2p\", kidId=\"{sender_id}|{unique_key_id}|{algorithm}\", algorithm=\"ed25519\", created=\"1606970629\", expires=\"1607030629\", headers=\"(created) (expires) digest\", signature=\"Base64(signing content)",
- "header": {
- "version": "1.0.0",
- "message_id": "789",
- "message_ts": "",
- "action": "notify",
- "status": "rcvd",
- "status_reason_code": "rjct.version.invalid",
- "status_reason_message": "string",
- "total_count": 21800,
- "completed_count": 50,
- "sender_id": "civilregistry.example.org",
- "receiver_id": "registry.example.org",
- "is_msg_encrypted": false,
- "meta": { }
}, - "message": {
- "transaction_id": 123456789,
- "receipt_information": {
- "receipt_type": "REGISTER",
- "beneficiaries": [
- {
- "@context": {
}, - "@id": "Person",
- "@type": "Person",
- "identifier": {
- "@id": "Identifier",
- "@type": "Identifier",
- "identifier_type": "UIN",
- "identifier_value": "847951632"
}, - "name": {
- "@type": "Name",
- "surname": "Phumchai",
- "given_name": "Sudarat",
- "second_name": "",
- "prefix": "Dr.",
- "suffix": "PhD"
}, - "household_status": "",
- "benefiting_entity": "Person",
- "sex": "female",
- "birth_date": "1995-09-21T11:20:00",
- "sub_region_code": "",
- "marital_status": "M",
- "poverty_score": "",
- "is_disabled": 2,
- "household_identifier": "",
- "programme_name": "",
- "programme_identifier": "",
- "registration_date": "2022-09-21T11:20:00",
- "enrolment_date": "2022-10-21T11:20:00",
- "suspension_date": "2023-09-21T11:20:00",
- "graduation_date": "2022-09-21T11:20:00",
- "enrolment_status": "3",
- "benefit_type": "2",
- "benefit_date": "",
- "benefit_value": "",
- "payroll_date": "",
- "payroll_amount": "",
- "payment_credit_date": "",
- "payment_credit_amount": "",
- "payment_charges": "",
- "payment_status": "1"
}
]
}
}
}
{- "errors": [
- {
- "code": "string",
- "message": "string"
}
]
}
The /registry/txn/status will be implemented by SR. This will check status of reach request using transaction_id and/or reference_id(s).
signature | string (MsgSignature) Signature of {header}+{message} body verified using sender's signing public key |
required | object Message header |
required | TxnStatusRequest (object) or EncryptedMessage (object) |
{- "signature": "Signature: namespace=\"g2p\", kidId=\"{sender_id}|{unique_key_id}|{algorithm}\", algorithm=\"ed25519\", created=\"1606970629\", expires=\"1607030629\", headers=\"(created) (expires) digest\", signature=\"Base64(signing content)",
- "header": {
- "version": "1.0.0",
- "message_id": "123",
- "message_ts": "",
- "action": "txn-status",
- "sender_id": "spp.example.org",
- "receiver_id": "pymts.example.org",
- "total_count": 21800,
- "is_msg_encrypted": false,
- "meta": { }
}, - "message": {
- "transaction_id": 123456789,
- "txnstatus_request": {
- "reference_id": "12345678901234567890",
- "txn_type": "search",
- "attribute_type": "transaction_id",
- "attribute_value": 123456789,
- "locale": "en"
}
}
}
{- "errors": [
- {
- "code": "string",
- "message": "string"
}
]
}
The /registry/txn/on-status will be implemented by SPMIS. The response with information about request and in some case it may contain data as well.
signature | string (MsgSignature) Signature of {header}+{message} body verified using sender's signing public key |
required | object Message header |
TxnStatusResponse (object) or EncryptedMessage (object) |
{- "signature": "Signature: namespace=\"g2p\", kidId=\"{sender_id}|{unique_key_id}|{algorithm}\", algorithm=\"ed25519\", created=\"1606970629\", expires=\"1607030629\", headers=\"(created) (expires) digest\", signature=\"Base64(signing content)",
- "header": {
- "version": "1.0.0",
- "message_id": "789",
- "message_ts": "",
- "action": "txn-on-status",
- "status": "rcvd",
- "status_reason_code": "rjct.version.invalid",
- "status_reason_message": "string",
- "total_count": 21800,
- "completed_count": 50,
- "sender_id": "civilregistry.example.org",
- "receiver_id": "registry.example.org",
- "is_msg_encrypted": false,
- "meta": { }
}, - "message": {
- "transaction_id": 123456789,
- "correlation_id": "9876543210",
- "txnstatus_response": {
- "type": "object",
- "description": "Response to search request. Multiple repsonses for each page can be pushed to the caller as an implementation!",
- "properties": {
- "transaction_id": {
- "$ref": "#/components/schemas/SearchRequest/properties/transaction_id"
}, - "correlation_id": {
- "$ref": "#/components/schemas/SearchResponse/properties/correlation_id"
}, - "search_response": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "reference_id": {
- "$ref": "#/components/schemas/TxnStatusRequest/properties/txnstatus_request/properties/reference_id"
}, - "timestamp": {
- "$ref": "#/components/schemas/MsgHeader_V1.0.0/properties/message_ts"
}, - "status": {
- "$ref": "#/components/schemas/UnSubscribeResponse/properties/status"
}, - "status_reason_code": {
- "$ref": "#/components/schemas/SearchStatusReasonCode"
}, - "status_reason_message": {
- "description": "Status reason code message. Helps actionanble messaging for systems/end users",
- "type": "string",
- "maxLength": 999
}, - "data": {
- "type": "object",
- "description": "Search result record as an outcome of search/subscribe action\n",
- "properties": {
- "version": {
- "type": "string",
- "default": "1.0.0"
}, - "reg_records": {
- "description": "The \"Person\" object contains fields expected in response of search\n@context: https://schema.spdci.org/extensions/ibr/v1/Person.jsonld <br>\n@type: \"@context\" <br>\n@container: \"@set\" <br>\n",
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/ReceiptRequest/properties/receipt_information/properties/beneficiaries/items"
}
}
}, - "required": [
- "reg_records"
]
}, - "pagination": {
- "$ref": "#/components/schemas/SearchResponse/properties/search_response/items/properties/pagination"
}, - "locale": {
- "$ref": "#/components/schemas/TxnStatusRequest/properties/txnstatus_request/properties/locale"
}
}, - "required": [
- "reference_id",
- "timestamp",
- "status"
]
}
}
}, - "required": [
- "transaction_id",
- "correlation_id",
- "search_response"
]
}
}
}
{- "errors": [
- {
- "code": "string",
- "message": "string"
}
]
}
The sync search api will accept request and will send response immediately The search request message consist of reg_event_type, query_type, query, sort, pagination, consent, authorize, locale. The SR will validate the request and will send response to on-search endpoint. Information for each field is given below.
signature | string (MsgSignature) Signature of {header}+{message} body verified using sender's signing public key |
required | object Message header |
required | SearchRequest (object) or EncryptedMessage (object) The search data using which registry search to be performed |
{- "signature": "Signature: namespace=\"g2p\", kidId=\"{sender_id}|{unique_key_id}|{algorithm}\", algorithm=\"ed25519\", created=\"1606970629\", expires=\"1607030629\", headers=\"(created) (expires) digest\", signature=\"Base64(signing content)",
- "header": {
- "version": "1.0.0",
- "message_id": "123",
- "message_ts": "",
- "action": "search",
- "sender_id": "spp.example.org",
- "receiver_id": "pymts.example.org",
- "total_count": 21800,
- "is_msg_encrypted": false,
- "meta": { }
}, - "message": {
- "transaction_id": 123456789,
- "search_request": [
- {
- "reference_id": "12345678901234567890",
- "timestamp": "",
- "search_criteria": {
- "version": "1.0.0",
- "reg_event_type": "REGISTER",
- "query_type": "idtype-value",
- "query": {
- "type": "ns:org:QueryType:GraphQl",
- "value": {
- "expression": " query GeBirthRecordById: { person: (UIN: \"1\") { BRN, name, gender, birthDate, birthPlace, parents } }"
}
}, - "sort": [
- {
- "attribute_name": "YOB",
- "sort_order": "asc"
}
], - "pagination": {
- "page_size": 2000,
- "page_number": 5
}, - "consent": {
- "@type": "Consent",
- "ts": {
- "$ref": "#/components/schemas/MsgHeader_V1.0.0/properties/message_ts"
}, - "purpose": {
- "text": {
- "type": "string"
}, - "code": {
- "type": "string",
- "description": "From a fixed set, documented at refUri"
}, - "ref_uri": {
- "type": "string",
- "format": "uri",
- "description": "Uri to provide more info on consent codes"
}
}
}, - "authorize": {
- "@type": "Authorize",
- "ts": {
- "$ref": "#/components/schemas/MsgHeader_V1.0.0/properties/message_ts"
}, - "purpose": {
- "text": {
- "type": "string"
}, - "code": {
- "type": "string",
- "description": "From a fixed set, documented at refUri"
}, - "ref_uri": {
- "type": "string",
- "format": "uri",
- "description": "Uri to provide more info on authorize codes"
}
}
}
}, - "locale": "en"
}
]
}
}
{- "errors": [
- {
- "code": "string",
- "message": "string"
}
]
}
The /registry/sync/notify end point will be implemented by SPMIS to receive notification for subscribed event. The notification will be sent based on subscription criteria.
signature | string (MsgSignature) Signature of {header}+{message} body verified using sender's signing public key |
required | object Message header |
NotifyEventRequest (object) or EncryptedMessage (object) |
{- "signature": "Signature: namespace=\"g2p\", kidId=\"{sender_id}|{unique_key_id}|{algorithm}\", algorithm=\"ed25519\", created=\"1606970629\", expires=\"1607030629\", headers=\"(created) (expires) digest\", signature=\"Base64(signing content)",
- "header": {
- "version": "1.0.0",
- "message_id": "789",
- "message_ts": "",
- "action": "notify",
- "status": "rcvd",
- "status_reason_code": "rjct.version.invalid",
- "status_reason_message": "string",
- "total_count": 21800,
- "completed_count": 50,
- "sender_id": "civilregistry.example.org",
- "receiver_id": "registry.example.org",
- "is_msg_encrypted": false,
- "meta": { }
}, - "message": {
- "transaction_id": 123456789,
- "notify_event": [
- {
- "reference_id": "12345678901234567890",
- "timestamp": "",
- "data": {
- "version": "1.0.0",
- "reg_type": "ns:org:RegistryType:Civil",
- "reg_event_type": "spdci-common:RegistryEventType:LiveBirth",
- "reg_record_type": "spdci-extensions-dci:Person",
- "reg_records": {
- "type": "object",
- "description": "@context: https://schema.spdci.org/CRVSPerson\" <br>\n@type: \"Consent\"\n",
- "example": {
- "@type": "CRVSPerson",
- "CRVSPerson": {
- "@type": "rdfs:Class",
- "@context": {
- "name": {
- "@id": "schema:name",
- "@type": "xsd:string"
}, - "givenName": {
- "@id": "schema:givenName",
- "@type": "xsd:string"
}, - "familyName": {
- "@id": "schema:familyName",
- "@type": "xsd:string"
}, - "additionalName": {
- "@id": "schema:additionalName",
- "@type": "xsd:string"
}, - "gender": {
- "@id": "schema:gender",
- "@type": "xsd:string"
}, - "birthDate": {
- "@id": "schema:birthDate",
- "@type": "xsd:date"
}, - "birthPlace": {
- "@id": "schema:birthPlace",
- "@type": "schema:GeoCoordinates"
}, - "deathDate": {
- "@id": "schema:deathDate",
- "@type": "xsd:date"
}, - "deathPlace": {
- "@id": "schema:deathPlace",
- "@type": "schema:GeoCoordinates"
}, - "maritalStatus": {
- "@id": "schema:maritalStatus",
- "@type": "xsd:string"
}, - "honorificPrefix": {
- "@id": "schema:honorificPrefix",
- "@type": "xsd:string"
}, - "honorificSuffix": {
- "@id": "schema:honorificSuffix",
- "@type": "xsd:string"
}, - "emails": {
- "@container": "@set",
- "@id": "schema:email",
- "@type": "xsd:string"
}, - "telephones": {
- "@container": "@set",
- "@id": "schema:telephone",
- "@type": "xsd:string"
}, - "address": {
- "@id": "schema:address",
- "@type": "schema:GeoCoordinates"
},
}
},
}
}
}, - "locale": "en"
}
]
}
}
{- "errors": [
- {
- "code": "string",
- "message": "string"
}
]
}
The /registry/sync/txn/status will be implemented by SR. This will check status of reach request using transaction_id and/or reference_id(s).
signature | string (MsgSignature) Signature of {header}+{message} body verified using sender's signing public key |
required | object Message header |
required | TxnStatusRequest (object) or EncryptedMessage (object) |
{- "signature": "Signature: namespace=\"g2p\", kidId=\"{sender_id}|{unique_key_id}|{algorithm}\", algorithm=\"ed25519\", created=\"1606970629\", expires=\"1607030629\", headers=\"(created) (expires) digest\", signature=\"Base64(signing content)",
- "header": {
- "version": "1.0.0",
- "message_id": "123",
- "message_ts": "",
- "action": "txn-status",
- "sender_id": "spp.example.org",
- "receiver_id": "pymts.example.org",
- "total_count": 21800,
- "is_msg_encrypted": false,
- "meta": { }
}, - "message": {
- "transaction_id": 123456789,
- "txnstatus_request": {
- "reference_id": "12345678901234567890",
- "txn_type": "search",
- "attribute_type": "transaction_id",
- "attribute_value": 123456789,
- "locale": "en"
}
}
}
{- "errors": [
- {
- "code": "string",
- "message": "string"
}
]
}
transaction_id required | string <= 99 characters
|
required | Array of objects
|
{- "transaction_id": 123456789,
- "search_request": [
- {
- "reference_id": "12345678901234567890",
- "timestamp": "",
- "search_criteria": {
- "version": "1.0.0",
- "reg_event_type": "REGISTER",
- "query_type": "idtype-value",
- "query": {
- "type": "ns:org:QueryType:GraphQl",
- "value": {
- "expression": " query GeBirthRecordById: { person: (UIN: \"1\") { BRN, name, gender, birthDate, birthPlace, parents } }"
}
}, - "sort": [
- {
- "attribute_name": "YOB",
- "sort_order": "asc"
}
], - "pagination": {
- "page_size": 2000,
- "page_number": 5
}, - "consent": {
- "@type": "Consent",
- "ts": {
- "$ref": "#/components/schemas/MsgHeader_V1.0.0/properties/message_ts"
}, - "purpose": {
- "text": {
- "type": "string"
}, - "code": {
- "type": "string",
- "description": "From a fixed set, documented at refUri"
}, - "ref_uri": {
- "type": "string",
- "format": "uri",
- "description": "Uri to provide more info on consent codes"
}
}
}, - "authorize": {
- "@type": "Authorize",
- "ts": {
- "$ref": "#/components/schemas/MsgHeader_V1.0.0/properties/message_ts"
}, - "purpose": {
- "text": {
- "type": "string"
}, - "code": {
- "type": "string",
- "description": "From a fixed set, documented at refUri"
}, - "ref_uri": {
- "type": "string",
- "format": "uri",
- "description": "Uri to provide more info on authorize codes"
}
}
}
}, - "locale": "en"
}
]
}
transaction_id required | string <= 99 characters
|
correlation_id required | string <= 99 characters
|
required | Array of objects |
{- "transaction_id": 123456789,
- "correlation_id": "9876543210",
- "search_response": [
- {
- "reference_id": "12345678901234567890",
- "timestamp": "",
- "status": "rcvd",
- "status_reason_code": "rjct.reference_id.invalid",
- "status_reason_message": "string",
- "data": {
- "version": "1.0.0",
- "reg_records": [
- {
- "@context": {
}, - "@id": "Person",
- "@type": "Person",
- "identifier": {
- "@id": "Identifier",
- "@type": "Identifier",
- "identifier_type": "UIN",
- "identifier_value": "847951632"
}, - "name": {
- "@type": "Name",
- "surname": "Phumchai",
- "given_name": "Sudarat",
- "second_name": "",
- "prefix": "Dr.",
- "suffix": "PhD"
}, - "birth_date": "1995-09-21T11:20:00",
- "sex": "female",
- "marital_status": "M",
- "is_disabled": 2,
- "disability_identifier": {
- "@id": "Identifier",
- "@type": "Identifier",
- "identifier_type": "UIN",
- "identifier_value": "753869421"
}, - "disability_type": "",
- "functional_limitation_type": "d132",
- "functional_severity": "0",
- "nationality": "ISO 3166-2:DZ",
- "employment_status": "1",
- "is_deceased": "2",
- "death_date": "",
- "ethnicity": "",
- "address": {
- "@id": "Address_1",
- "@type": "Address",
- "address_line1": "Bophut Koh Samui",
- "address_line2": "Surat, Near Big Buddha Beach",
- "locality": "Thani",
- "sub_region_code": "SH",
- "region_code": "A205",
- "postal_code": "84320",
- "country_code": "TH",
- "geo_location": {
- "@id": "GeoLocation_1",
- "@type": "GeoLocation",
- "plus_code": {
- "global_code": "8FW4V900+",
- "geometry": {
- "@id": "geometry",
- "@type": "GeoLocation",
- "bounds": {
- "@id": "bounds",
- "@type": "geometry",
- "northeast": {
- "@id": "northeast",
- "@type": "GeoCoordinates",
- "latitude": 48.900000000000006,
- "longitude": 2.4000000000000057
}, - "southwest": {
- "@id": "southwest",
- "@type": "GeoCoordinates",
- "latitude": 48.849999999999994,
- "longitude": 2.3499999999999943
}
}, - "location": {
- "@id": "location",
- "@type": "GeoCoordinates",
- "latitude": 48.875,
- "longitude": 2.375
}
}
}
}
}, - "phone_number": "+66891234567",
- "email": "sudarat.phumchai@example.com",
- "household_identifier": "",
- "household_status": "1",
- "poverty_score": "2.5",
- "parent1_identifier": {
- "@id": "Identifier",
- "@type": "Identifier",
- "identifier_type": "UIN",
- "identifier_value": "753869421"
}, - "parent2_identifier": {
- "@id": "Identifier",
- "@type": "Identifier",
- "identifier_type": "UIN",
- "identifier_value": "852963741"
}, - "registration_date": "2022-09-21T11:20:00",
- "last_updated": "2022-09-21T11:20:00"
}
]
}, - "pagination": {
- "page_size": 2000,
- "page_number": 5,
- "total_count": 24250
}, - "locale": "en"
}
]
}
transaction_id required | string <= 99 characters
|
required | Array of objects |
{- "transaction_id": 123456789,
- "subscribe_request": [
- {
- "reference_id": "12345678901234567890",
- "timestamp": "",
- "subscribe_criteria": {
- "version": "1.0.0",
- "reg_type": "ns:org:RegistryType:IBR",
- "reg_event_type": "REGISTER",
- "frequency": {
- "start_time": "",
- "end_time": "",
- "frequency": "string"
}, - "filter_type": "idtype-value",
- "filter": {
- "type": "ns:org:QueryType:GraphQl",
- "value": {
- "expression": " query GeBirthRecordById: { person: (UIN: \"1\") { BRN, name, gender, birthDate, birthPlace, parents } }"
}
}, - "notify_record_type": "Person",
- "authorize": {
- "@type": "Authorize",
- "ts": {
- "$ref": "#/components/schemas/MsgHeader_V1.0.0/properties/message_ts"
}, - "purpose": {
- "text": {
- "type": "string"
}, - "code": {
- "type": "string",
- "description": "From a fixed set, documented at refUri"
}, - "ref_uri": {
- "type": "string",
- "format": "uri",
- "description": "Uri to provide more info on authorize codes"
}
}
}
}, - "locale": "en"
}
]
}
transaction_id required | string <= 99 characters
|
correlation_id required | string <= 99 characters
|
required | Array of objects |
{- "transaction_id": 123456789,
- "correlation_id": "9876543210",
- "subscribe_response": [
- {
- "reference_id": "12345678901234567890",
- "timestamp": "",
- "status": "rcvd",
- "status_reason_code": "rjct.reference_id.invalid",
- "status_reason_message": "string",
- "subscriptions": [
- {
- "version": "1.0.0",
- "code": "string",
- "status": "subscribe",
- "timestamp": "",
- "reg_type": "ns:org:RegistryType:Civil",
- "reg_event_type": "spdci-common:RegistryEventType:LiveBirth",
- "frequency": {
- "start_time": "",
- "end_time": "",
- "frequency": "string"
}, - "filter_type": "idtype-value",
- "filter": {
- "type": "ns:org:QueryType:GraphQl",
- "value": {
- "expression": " query GeBirthRecordById: { person: (UIN: \"1\") { BRN, name, gender, birthDate, birthPlace, parents } }"
}
}, - "notify_record_type": "spdci-extensions-dci:Person",
- "locale": "en"
}
], - "pagination": {
- "page_size": 2000,
- "page_number": 5,
- "total_count": 24250
}, - "locale": "en"
}
]
}
transaction_id required | string <= 99 characters
|
required | object Receipt information contains receipt type and list of beneficiaries
|
{- "transaction_id": 123456789,
- "receipt_information": {
- "receipt_type": "REGISTER",
- "beneficiaries": [
- {
- "@context": {
}, - "@id": "Person",
- "@type": "Person",
- "identifier": {
- "@id": "Identifier",
- "@type": "Identifier",
- "identifier_type": "UIN",
- "identifier_value": "847951632"
}, - "name": {
- "@type": "Name",
- "surname": "Phumchai",
- "given_name": "Sudarat",
- "second_name": "",
- "prefix": "Dr.",
- "suffix": "PhD"
}, - "household_status": "",
- "benefiting_entity": "Person",
- "sex": "female",
- "birth_date": "1995-09-21T11:20:00",
- "sub_region_code": "",
- "marital_status": "M",
- "poverty_score": "",
- "is_disabled": 2,
- "household_identifier": "",
- "programme_name": "",
- "programme_identifier": "",
- "registration_date": "2022-09-21T11:20:00",
- "enrolment_date": "2022-10-21T11:20:00",
- "suspension_date": "2023-09-21T11:20:00",
- "graduation_date": "2022-09-21T11:20:00",
- "enrolment_status": "3",
- "benefit_type": "2",
- "benefit_date": "",
- "benefit_value": "",
- "payroll_date": "",
- "payroll_amount": "",
- "payment_credit_date": "",
- "payment_credit_amount": "",
- "payment_charges": "",
- "payment_status": "1"
}
]
}
}
transaction_id required | string <= 99 characters
|
required | object Receipt information contains receipt type and list of beneficiaries
|
{- "transaction_id": 123456789,
- "receipt_information": {
- "receipt_type": "REGISTER",
- "beneficiaries": [
- {
- "@context": {
}, - "@id": "Person",
- "@type": "Person",
- "identifier": {
- "@id": "Identifier",
- "@type": "Identifier",
- "identifier_type": "UIN",
- "identifier_value": "847951632"
}, - "name": {
- "@type": "Name",
- "surname": "Phumchai",
- "given_name": "Sudarat",
- "second_name": "",
- "prefix": "Dr.",
- "suffix": "PhD"
}, - "household_status": "",
- "benefiting_entity": "Person",
- "sex": "female",
- "birth_date": "1995-09-21T11:20:00",
- "sub_region_code": "",
- "marital_status": "M",
- "poverty_score": "",
- "is_disabled": 2,
- "household_identifier": "",
- "programme_name": "",
- "programme_identifier": "",
- "registration_date": "2022-09-21T11:20:00",
- "enrolment_date": "2022-10-21T11:20:00",
- "suspension_date": "2023-09-21T11:20:00",
- "graduation_date": "2022-09-21T11:20:00",
- "enrolment_status": "3",
- "benefit_type": "2",
- "benefit_date": "",
- "benefit_value": "",
- "payroll_date": "",
- "payroll_amount": "",
- "payment_credit_date": "",
- "payment_credit_amount": "",
- "payment_charges": "",
- "payment_status": "1"
}
]
}
}
transaction_id required | string <= 99 characters
|
required | object |
{- "transaction_id": 123456789,
- "txnstatus_request": {
- "reference_id": "12345678901234567890",
- "txn_type": "search",
- "attribute_type": "transaction_id",
- "attribute_value": 123456789,
- "locale": "en"
}
}
transaction_id required | string <= 99 characters
|
correlation_id required | string <= 99 characters
|
required | object |
{- "transaction_id": 123456789,
- "correlation_id": "9876543210",
- "txnstatus_response": {
- "type": "object",
- "description": "Response to search request. Multiple repsonses for each page can be pushed to the caller as an implementation!",
- "properties": {
- "transaction_id": {
- "$ref": "#/components/schemas/SearchRequest/properties/transaction_id"
}, - "correlation_id": {
- "$ref": "#/components/schemas/SearchResponse/properties/correlation_id"
}, - "search_response": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "reference_id": {
- "$ref": "#/components/schemas/TxnStatusRequest/properties/txnstatus_request/properties/reference_id"
}, - "timestamp": {
- "$ref": "#/components/schemas/MsgHeader_V1.0.0/properties/message_ts"
}, - "status": {
- "$ref": "#/components/schemas/UnSubscribeResponse/properties/status"
}, - "status_reason_code": {
- "$ref": "#/components/schemas/SearchStatusReasonCode"
}, - "status_reason_message": {
- "description": "Status reason code message. Helps actionanble messaging for systems/end users",
- "type": "string",
- "maxLength": 999
}, - "data": {
- "type": "object",
- "description": "Search result record as an outcome of search/subscribe action\n",
- "properties": {
- "version": {
- "type": "string",
- "default": "1.0.0"
}, - "reg_records": {
- "description": "The \"Person\" object contains fields expected in response of search\n@context: https://schema.spdci.org/extensions/ibr/v1/Person.jsonld <br>\n@type: \"@context\" <br>\n@container: \"@set\" <br>\n",
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/ReceiptRequest/properties/receipt_information/properties/beneficiaries/items"
}
}
}, - "required": [
- "reg_records"
]
}, - "pagination": {
- "$ref": "#/components/schemas/SearchResponse/properties/search_response/items/properties/pagination"
}, - "locale": {
- "$ref": "#/components/schemas/TxnStatusRequest/properties/txnstatus_request/properties/locale"
}
}, - "required": [
- "reference_id",
- "timestamp",
- "status"
]
}
}
}, - "required": [
- "transaction_id",
- "correlation_id",
- "search_response"
]
}
}
transaction_id required | string <= 99 characters
|
required | Array of objects |
{- "transaction_id": 123456789,
- "notify_event": [
- {
- "reference_id": "12345678901234567890",
- "timestamp": "",
- "data": {
- "version": "1.0.0",
- "reg_type": "ns:org:RegistryType:Civil",
- "reg_event_type": "spdci-common:RegistryEventType:LiveBirth",
- "reg_record_type": "spdci-extensions-dci:Person",
- "reg_records": {
- "type": "object",
- "description": "@context: https://schema.spdci.org/CRVSPerson\" <br>\n@type: \"Consent\"\n",
- "example": {
- "@type": "CRVSPerson",
- "CRVSPerson": {
- "@type": "rdfs:Class",
- "@context": {
- "name": {
- "@id": "schema:name",
- "@type": "xsd:string"
}, - "givenName": {
- "@id": "schema:givenName",
- "@type": "xsd:string"
}, - "familyName": {
- "@id": "schema:familyName",
- "@type": "xsd:string"
}, - "additionalName": {
- "@id": "schema:additionalName",
- "@type": "xsd:string"
}, - "gender": {
- "@id": "schema:gender",
- "@type": "xsd:string"
}, - "birthDate": {
- "@id": "schema:birthDate",
- "@type": "xsd:date"
}, - "birthPlace": {
- "@id": "schema:birthPlace",
- "@type": "schema:GeoCoordinates"
}, - "deathDate": {
- "@id": "schema:deathDate",
- "@type": "xsd:date"
}, - "deathPlace": {
- "@id": "schema:deathPlace",
- "@type": "schema:GeoCoordinates"
}, - "maritalStatus": {
- "@id": "schema:maritalStatus",
- "@type": "xsd:string"
}, - "honorificPrefix": {
- "@id": "schema:honorificPrefix",
- "@type": "xsd:string"
}, - "honorificSuffix": {
- "@id": "schema:honorificSuffix",
- "@type": "xsd:string"
}, - "emails": {
- "@container": "@set",
- "@id": "schema:email",
- "@type": "xsd:string"
}, - "telephones": {
- "@container": "@set",
- "@id": "schema:telephone",
- "@type": "xsd:string"
}, - "address": {
- "@id": "schema:address",
- "@type": "schema:GeoCoordinates"
},
}
},
}
}
}, - "locale": "en"
}
]
}
transaction_id required | string <= 99 characters
|
timesstamp | string <date-time>
|
subscription_codes | Array of strings[ items <= 99 characters ] |
{- "transaction_id": 123456789,
- "timesstamp": "",
- "subscription_codes": [
- "string"
]
}
transaction_id required | string <= 99 characters
|
correlation_id required | string <= 99 characters
|
timesatmp | string <date-time>
|
status required | string Enum: "rcvd" "pdng" "succ" "rjct" Request (e.g disburse, link, unlink, resolve, issue, search, verify, etc.,) status: |
status_reason_code | string (UnSubscribeStatusReasonCode) Enum: "rjct.reference_id.invalid" "rjct.reference_id.duplicate" "rjct.timestamp.invalid" "rjct.subscription_code.invalid" "rjct.requester.invalid" "rjct.event.already_unsubscribed" Identity verification request status reason codes |
status_reason_message | string <= 999 characters Status reason code message. Helps actionanble messaging for systems/end users |
Array of objects |
{- "transaction_id": 123456789,
- "correlation_id": "9876543210",
- "timesatmp": "",
- "status": "rcvd",
- "status_reason_code": "rjct.reference_id.invalid",
- "status_reason_message": "string",
- "subscription_status": [
- {
- "code": "string",
- "status": "subscribe"
}
]
}
required | object |
ciphertext required | string This is the result of encrypting the plaintext using the CEK and the IV. It's Base64Url-encoded. |
encrypted_key required | string The base64-url encoded encrypted key |
tag required | string This is a Base64Url-encoded value that provides evidence of the integrity and authenticity of the ciphertext, Initialization Vector, and Additional Authenticated Data |
iv required | string This is a Base64Url-encoded random bit string to be used as the Initialization Vector (IV) when encrypting the plaintext to produce the ciphertext. The size of the IV depends on the encryption algorithm used. |
{- "header": {
- "alg": "string",
- "enc": "string",
- "kid": "string"
}, - "ciphertext": "string",
- "encrypted_key": "string",
- "tag": "string",
- "iv": "string"
}
Identity verification request status reason codes
"rjct.reference_id.invalid"