Validate age

If you only need to validate someone's age, you can choose to include only the age field in extractFields while creating the transaction. Only the fields in extractFields will be returned in the transaction results.

POST https://api.cm.com/id-scan/v1/transactions

Content-Type: application/json
Authorization: Bearer GENERATED_TOKEN_HERE
{
    "tasks": [
        "document_scan"
    ],
    "settings": {
        "documentScan": {
            "extractFields": [
                "age"
            ]
        }
    }
}

📘

If you add fields to extractFields, the document image url and portrait image file will not be included in the response. To include them, make sure to add document_image and/or portrait as well.

For a full list of all options see the API reference

Once the transaction is completed, only the requested field will be returned if it is present in the provided document.

GET https://api.cm.com/id-scan/v1/transactions/{transactionId}/results/{resultId}

{
    "id": "6e96a20f-193e-4624-bf24-10962ea2eb18",
    "state": "completed",
    "tasks": [
        {
            "type": "document_scan",
            "state": "completed",
            "attempts": 1,
            "score": 0.98,
            "result": [
                {
                    "field": "age",
                    "validity": "valid",
                    "comparison": "match",
                    "locale": null,
                    "values": [
                        {
                            "source": "mrz",
                            "value": "45"
                        },
                        {
                            "source": "visual",
                            "value": "45"
                        }
                    ]
                }
            ],
            "files": [
                {
                    "category": "document",
                    "type": "passport",
                    "name": "Netherlands - ePassport (2024)",
                    "score": 0.98,
                    "url": null
                }
            ]
        }
    ]
}