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:

ParameterTypeRequiredDescription
nafathCallbackUrlStringTrueCallback URL for Nafath. This callback will be called when the status of the Nafath request is updated.
nafathCallbackHeader1NameStringTrueName of the first callback header
nafathCallbackHeader1ValueStringTrueValue of the first callback header
nafathCallbackHeader2NameStringTrueName of the second callback header
nafathCallbackHeader2ValueStringTrueValue 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:

FieldTypeDescription
nafath_random_noStringThe random number response from the Nafath request
nafath_request_uuidStringThe UUID of the Nafath request
national_idStringThe national ID associated with the Nafath request
statusEnum NafathStatusThe status of the Nafath request
error_messageStringError message if any
session_uuidStringThe session UUID of the temporary merchant
mobileStringThe mobile number of the temporary merchant
license_nameStringThe name of the license
license_numberStringThe 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

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

StatusDescription
WAITINGThe request is waiting for processing
COMPLETEDThe request has been completed successfully
EXPIREDThe request has expired
REJECTEDThe request has been rejected
ERRORThere was an error processing