> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dojah.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Advanced Ghana Card

> Look up a Ghana Card and match a selfie against the photo on the national identity record in the same call.

POST
`/api/v1/gh/kyc/card/facial`

Look up a Ghana Card and match a selfie against the photograph on the national identity record. The response returns the holder’s identity, card validity, addresses, phone numbers, the card photo, and the selfie match result.

This is a richer check than [Ghana Card](https://docs.dojah.io/api-reference/individual-verification/ghana/ghana-card.md), which only looks up the card number.

## Headers

| Header | Required | Description |
| - | - | - |
| `Authorization` | Yes | Your app's secret key, sent as-is — *not* `Bearer`. |
| `AppId` | Yes | The App ID from your dashboard. |
| `Content-Type` | Yes | `application/json` |

## Body parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `id` | string | Yes | Ghana Card number, for example `GHA-123456789-0`. |
| `selfie_image` | string | Yes | Selfie as base64 JPEG or PNG. A `data:image/jpeg;base64,` or `data:image/png;base64,` prefix is optional. |

## Response

Returns an `entity` with the holder’s identity, card dates, addresses, phone numbers, a base64 `photo`, and `selfie_verification`. `validation` is `null` when no extra validation payload is returned.

### Identity

| Field | Type | Description |
| - | - | - |
| `entity.id_number` | string | Ghana Card number on the record |
| `entity.first_name` | string | First name |
| `entity.last_name` | string | Surname |
| `entity.middle_name` | string | Middle name. Empty string when none is on file |
| `entity.date_of_birth` | string | Date of birth, `YYYY-MM-DD` |
| `entity.age` | number | Age derived from the date of birth |
| `entity.gender` | string | Gender, for example `Male` |
| `entity.place_of_birth` | string | Place of birth |
| `entity.nationality` | string | Nationality |
| `entity.photo` | string | Base64-encoded JPEG photograph from the card |

### Card

| Field | Type | Description |
| - | - | - |
| `entity.card_id` | string | Card serial printed on the Ghana Card |
| `entity.card_valid_from` | string | Card validity start, `YYYY-MM-DD` |
| `entity.card_valid_to` | string | Card validity end, `YYYY-MM-DD` |

### Addresses

`entity.addresses` is an array. Each item:

| Field | Type | Description |
| - | - | - |
| `type` | string | Address type, for example `Residence` |
| `community` | string | Community |
| `town` | string | Town |
| `district` | string | District |
| `region` | string | Region |
| `country` | string | Country |
| `postal_code` | string | Postal code |
| `digital_address` | string | Ghana digital address |
| `gps.latitude` | string | Latitude |
| `gps.longitude` | string | Longitude |

### Phone numbers

`entity.phone_numbers` is an array. Each item:

| Field | Type | Description |
| - | - | - |
| `type` | string | Number type, for example `Mobile` |
| `phone_number` | string | Phone number on the record |
| `network` | string | Mobile network, for example `MTN` |

### Selfie verification

| Field | Type | Description |
| - | - | - |
| `entity.selfie_verification.match` | boolean | `true` when the selfie matches the card photo |
| `entity.selfie_verification.verified` | boolean | `true` when the selfie check completed successfully |
| `entity.selfie_verification.status` | string | Check status, for example `success` |

### Validation

`entity.validation` is a sibling of `selfie_verification` on `entity`.

| Field | Type | Description |
| - | - | - |
| `entity.validation` | object \| null | Extra validation payload, or `null` when none is returned |

> [!WARNING]
>
> Names, date of birth, address, phone number, GPS, and `photo` are sensitive personal data. Store only what you need, keep it encrypted at rest, and never write these values to logs.

## Errors

| Code | Meaning |
| - | - |
| `400` | Bad request — a required field is missing, or the selfie is not a valid base64 JPEG or PNG. |
| `401` | Unauthorized — check your key and `AppId` (no `Bearer` prefix). |
| `402` | Insufficient wallet balance. [Fund your wallet](https://docs.dojah.io/api-reference/core-concepts/wallet-billing.md). |
| `404` | No record found for the supplied Ghana Card number. |
| `424` | The upstream source was unavailable — retry shortly. |
| `429` | Too many requests — back off and retry. |

```bash cURL theme={null}
curl --request POST \
  "https://api.dojah.io/api/v1/gh/kyc/card/facial" \
  -H "Authorization: {{secret_key}}" \
  -H "AppId: {{app_id}}" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "GHA-123456789-0",
    "selfie_image": "/9j/4AAQSkZJRgABAQ…"
  }'
```

```js Node.js theme={null}
const res = await fetch("https://api.dojah.io/api/v1/gh/kyc/card/facial", {
  method: "POST",
  headers: {
    Authorization: process.env.DOJAH_SECRET_KEY,
    AppId: process.env.DOJAH_APP_ID,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    id: "GHA-123456789-0",
    selfie_image: "/9j/4AAQSkZJRgABAQ…",
  }),
});
const data = await res.json();
```

```python Python theme={null}
import os, requests

res = requests.post(
    "https://api.dojah.io/api/v1/gh/kyc/card/facial",
    headers={
        "Authorization": os.environ["DOJAH_SECRET_KEY"],
        "AppId": os.environ["DOJAH_APP_ID"],
    },
    json={
        "id": "GHA-123456789-0",
        "selfie_image": "/9j/4AAQSkZJRgABAQ…",
    },
)
data = res.json()
```

```json POST /api/v1/gh/kyc/card/facial theme={null}
{
  "entity": {
    "id_number": "GHA-123456789-0",
    "first_name": "JOHN",
    "last_name": "DOE",
    "middle_name": "",
    "date_of_birth": "1990-01-15",
    "age": 34,
    "gender": "Male",
    "place_of_birth": "Greater Accra",
    "nationality": "Ghana",
    "card_id": "AS0000000",
    "card_valid_from": "2021-02-10",
    "card_valid_to": "2030-08-31",
    "addresses": [
      {
        "type": "Residence",
        "community": "AB",
        "town": "Abuontem",
        "district": "Bosomtwe",
        "region": "Ashanti",
        "country": "Ghana",
        "postal_code": "AT-1000",
        "digital_address": "AT-1000-0000",
        "gps": {
          "latitude": "6.5814001723572",
          "longitude": "-1.56362405749"
        }
      }
    ],
    "phone_numbers": [
      {
        "type": "Mobile",
        "phone_number": "0200000000",
        "network": "MTN"
      }
    ],
    "photo": "/9j/4AAQSkZJRgABAQ…",
    "selfie_verification": {
      "match": true,
      "verified": true,
      "status": "success"
    },
    "validation": null
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.