1. Migrate Merchant Account

This endpoint facilitates the migration of a merchant's account to a new system. The migration process involves transferring various account details, such as registration type, license number, mobile number, and other personal and business information. The endpoint ensures that the account migration is processed securely and accurately.This endpoint migrates an account based on the provided registration migration request.

❗️

Authorization

This endpoint requires the user to have the role MERCHANT_API_ACCOUNT

Endpoint

POST  /api/partner/register/migrate

Request Headers

HeaderRequiredDescription
AuthorizationYesBearer token provided by Authentication Endpoint
AcceptYesIt must be set to application/JSON.
Content-TypeYesIt must be set to application/JSON.
{
  "Authorization": "Bearer [id_token]",
  "Accept": "application/json",
  "Content-Type": "application/json"
}

Request Body Parameters

FieldTypeRequiredDescription
sessionUuidStringTrueThe session UUID of the registration
registrationTypeStringTrueThe registration type. Allowed values: "cr", "freelancer"
licenseNumberStringTrueThe license number of the cr or freelancer
mobileNumberStringTrueThe mobile number of the merchant
hijriYearStringTrueThe Hijri year
hijriMonthStringTrueThe Hijri month
hijriDayStringTrueThe Hijri day
partnerProfileNoStringTrueThe partner profile number
ibanStringTrueThe IBAN of the merchant
bankSwiftNameStringTrueThe bank swift code
monthlySalesVolumedoubleTrueThe expected monthly sales volume
categoryDescriptionStringTrueThe category description
sellingScopeStringTrueThe selling scope. Allowed values: "domestic", "global"
nationalIdStringTrueThe national ID of the merchant
emailStringTrueThe email of the merchant
firstNameStringTrueThe first name of the merchant
lastNameStringTrueThe last name of the merchant
passwordStringTrueThe password of the merchant
nafathCallbackUrlStringTrueThe Nafath callback URL
nafathCallbackHeader1NameStringTrueThe name of the first Nafath callback header
nafathCallbackHeader1ValueStringTrueThe value of the first Nafath callback header
nafathCallbackHeader2NameStringTrueThe name of the second Nafath callback header
nafathCallbackHeader2ValueStringTrueThe value of the second Nafath callback header

An example of the request:

{
  "sessionUuid": "96ea8e22-edef-414b-9724-3bd2d494b710",
  "registrationType": "cr",
  "licenseNumber": "2041231231",
  "mobileNumber": "966501234567",
  "hijriYear": "1445",
  "hijriMonth": "02",
  "hijriDay": "16",
  "partnerProfileNo": "12312312",
  "iban": "SA1234567890123456789012",
  "bankSwiftName": "RJHISARI",
  "monthlySalesVolume": 10000,
  "categoryDescription": "Grocery",
  "sellingScope": "domestic",
  "nationalId": "1234567890",
  "email": "[email protected]",
  "firstName": "Mohammed",
  "lastName": "Ali",
  "password": "password",
  "nafathCallbackUrl": "https://example/nafath-callback",
  "nafathCallbackHeader1Name": "header1",
  "nafathCallbackHeader1Value": "value1",
  "nafathCallbackHeader2Name": "header2",
  "nafathCallbackHeader2Value": "value2"
}

Success Response

The response will be a JSON object of type RegistrationMigrationResponse.

FieldTypeDescription
mobileStringThe mobile number of the merchant
sessionUuidStringThe session UUID
successBooleanIndicates if the migration was successful
noteStringAny note regarding the response
nafathRandomNoStringThe random number to choose inside Nafath App

Example of the response:

{
  "mobile": "00966512345678",
  "sessionUuid": "96ea8e22-edef-414b-9724-3bd2d494b710",
  "success": true,
  "nafathRandomNo": "10",
  "note": "any note ..."
}

HTTP Status Codes

  • 200 OK: The account was successfully migrated.
  • 400 Bad Request: The request body is invalid or missing required fields.
  • 401 Unauthorized: The user is not authorized to perform this action.
  • 500 Internal Server Error: An unexpected error occurred on the server.