---
updatedAt: 2025-09-09T21:11:25.000Z
agentTools:
  projectIndex: https://developer.paylink.sa/llms.txt
---

# 5. Webhook for Nafath

These endpoints handle the registration and submission of additional information for partners. During these processes, a webhook is created to communicate with external services such as Nafath and send notifications and updates about the registration process.

## Overview

Webhook as the response for the call of the following endpoint URL:

```http
POST /api/partner/register/migrate
```

```http
POST /api/partner/register/add-info
```

## Webhook Parameters

The creation of the webhook is based on the following parameters provided in the request:

| Parameter                  | Type   | Required | Description                                                                                             |
| -------------------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------- |
| nafathCallbackUrl          | String | True     | Callback URL for Nafath. This callback will be called when the status of the Nafath request is updated. |
| nafathCallbackHeader1Name  | String | True     | Name of the first callback header                                                                       |
| nafathCallbackHeader1Value | String | True     | Value of the first callback header                                                                      |
| nafathCallbackHeader2Name  | String | True     | Name of the second callback header                                                                      |
| nafathCallbackHeader2Value | String | True     | Value of the second callback header                                                                     |

Example:

```json
{
  "nafathCallbackUrl": "https://nafath.com/callback",
  "nafathCallbackHeader1Name": "header1",
  "nafathCallbackHeader1Value": "header1Value",
  "nafathCallbackHeader2Name": "header2",
  "nafathCallbackHeader2Value": "header2Value"
}
```

## Webhook Request Body

The webhook is sent as a POST request to the provided `nafathCallbackUrl` with the following JSON body:

| Field                 | Type                                    | Description                                        |
| --------------------- | --------------------------------------- | -------------------------------------------------- |
| nafath\_random\_no    | String                                  | The random number response from the Nafath request |
| nafath\_request\_uuid | String                                  | The UUID of the Nafath request                     |
| national\_id          | String                                  | The national ID associated with the Nafath request |
| status                | Enum [NafathStatus](#nafathstatus-enum) | The status of the Nafath request                   |
| error\_message        | String                                  | Error message if any                               |
| session\_uuid         | String                                  | The session UUID of the temporary merchant         |
| mobile                | String                                  | The mobile number of the temporary merchant        |
| license\_name         | String                                  | The name of the license                            |
| license\_number       | String                                  | The number of the license                          |

Example of the request body:

```json
{
  "nafath_random_no": "12345",
  "nafath_request_uuid": "abcdef",
  "national_id": "1234567890",
  "status": "SUCCESS",
  "error_message": "None",
  "session_uuid": "12345678-1234-1234-1234-123456789012",
  "mobile": "966501234567",
  "license_name": "Business License",
  "license_number": "12345"
}
```

### `NafathStatus` Enum

The `NafathStatus` enum represents the possible statuses of the Nafath account:

| Status    | Description                                 |
| --------- | ------------------------------------------- |
| WAITING   | The request is waiting for processing       |
| COMPLETED | The request has been completed successfully |
| EXPIRED   | The request has expired                     |
| REJECTED  | The request has been rejected               |
| ERROR     | There was an error processing               |