Create customer
Create Customer
POST https://sandbox.mnasati.com/v1/customer
This endpoint allows you to create customer accounts.
Headers
Name
Type
Description
Content-Type
string
Application/JSON
Access Token
string
The JWT Key is generated from the Authorization method.
Request Body
Name
Type
Description
confirm_password
string
Password repeat
password
string
Password
phone
integer
Phone Number
country_id
integer
Country ID
name
string
Customer Name
{"status":true,"message":"New customer created successfully."}{ "message": "Not found."}Examples
import http.client
conn = http.client.HTTPSConnection("sandbox.mnasati.com")
payload = "{\"name\":\"john\",\"country_id\":1,\"email\":\"[email protected]\",\"phone\":\"966441424\",\"password\":\"1234@#$%%\",\"confirm_password\":\"1234@#$%%\"}"
headers = {
'Content-Type': "",
'Authorization-Jwt': ""
}
conn.request("POST", "/v1/customer", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.mnasati.com/v1/customer",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"name\":\"john\",\"country_id\":1,\"email\":\"[email protected]\",\"phone\":\"966441424\",\"password\":\"1234@#$%\",\"confirm_password\":\"1234@#$%\"}",
CURLOPT_HTTPHEADER => [
"Authorization-Jwt: ",
"Content-Type: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}Last updated
Was this helpful?