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:
POST /api/partner/register/migrate
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:
{
"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 | 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:
{
"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
NafathStatus
EnumThe 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 |
Updated 7 months ago