KSA v2: Sign up
Create an account in the Complyance test environment to use the KSA ZATCA API v2 (onboarding, reporting and clearance). This page documents API v2, a legacy version.
Use this API to create an account in the Complyance test environment. The account lets you use the ZATCA APIs: onboarding, reporting and clearance.
Send every required parameter in the format shown below.
Endpoint
http
POST https://<your-v2-api-host>/api/v1/proto/signUpUse the v2 API host you were given when your account was set up. If you no longer have it, contact support@complyance.io.
Examples
Sign upbash
curl -X POST https://<your-v2-api-host>/api/v1/proto/signUp \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{"email": "finance@acme.example", "password": "Example@123"}'Sign upjavascript
const inputBody = JSON.stringify({
email: 'finance@acme.example',
password: 'Example@123'
});
const headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
};
fetch('https://<your-v2-api-host>/api/v1/proto/signUp', {
method: 'POST',
body: inputBody,
headers: headers
})
.then(function (res) {
return res.json();
})
.then(function (body) {
console.log(body);
});Sign upruby
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
body = {
email: 'finance@acme.example',
password: 'Example@123'
}.to_json
result = RestClient.post 'https://<your-v2-api-host>/api/v1/proto/signUp', body, headers
p JSON.parse(result)Sign uppython
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
body = {
'email': 'finance@acme.example',
'password': 'Example@123'
}
r = requests.post('https://<your-v2-api-host>/api/v1/proto/signUp', json=body, headers=headers)
print(r.json())Sign upphp
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// The request body.
$request_body = array(
'email' => 'finance@acme.example',
'password' => 'Example@123',
);
try {
$response = $client->request('POST', 'https://<your-v2-api-host>/api/v1/proto/signUp', array(
'headers' => $headers,
'json' => $request_body,
));
print_r($response->getBody()->getContents());
} catch (\GuzzleHttp\Exception\BadResponseException $e) {
// Handle the exception or API errors.
print_r($e->getMessage());
}Sign upjava
URL obj = new URL("https://<your-v2-api-host>/api/v1/proto/signUp");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");
con.setDoOutput(true);
String body = "{\"email\": \"finance@acme.example\", \"password\": \"Example@123\"}";
try (OutputStream os = con.getOutputStream()) {
os.write(body.getBytes(StandardCharsets.UTF_8));
}
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());Request parameters
| Parameter | Required | Type | Description | Example |
|---|---|---|---|---|
email | Yes | string | The email address for the account you want to create. | finance@acme.example |
password | Yes | string | The password for your Complyance test account. It must contain at least one capital letter, one special character and one number. | Example@123 |
Request bodyjson
{
"email": "finance@acme.example",
"password": "Example@123"
}Response parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
refreshToken | string | A long-lived token, valid for one year. Store it securely: you use it to get a new access token every 24 hours. | eyJjdHkiOiJKV1QifQ.example-refresh-token.signature |
Responsejson
{
"refreshToken": "eyJjdHkiOiJKV1QifQ.example-refresh-token.signature"
}Next step
Sign in with the refresh token to get an access token.