Create Organization
curl --request POST \
--url https://sandbox.api.paylias.xyz/gateway/api/v1/csp/organization \
--header 'Content-Type: application/json' \
--data '
{
"admin_email": "admin@getsafepay.com",
"admin_first_name": "Ziyad",
"admin_last_name": "Parekh",
"admin_password": "$uper$3cur3",
"country": "US",
"name": "Safepay, Inc"
}
'import requests
url = "https://sandbox.api.paylias.xyz/gateway/api/v1/csp/organization"
payload = {
"admin_email": "admin@getsafepay.com",
"admin_first_name": "Ziyad",
"admin_last_name": "Parekh",
"admin_password": "$uper$3cur3",
"country": "US",
"name": "Safepay, Inc"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
admin_email: 'admin@getsafepay.com',
admin_first_name: 'Ziyad',
admin_last_name: 'Parekh',
admin_password: '$uper$3cur3',
country: 'US',
name: 'Safepay, Inc'
})
};
fetch('https://sandbox.api.paylias.xyz/gateway/api/v1/csp/organization', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.api.paylias.xyz/gateway/api/v1/csp/organization",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'admin_email' => 'admin@getsafepay.com',
'admin_first_name' => 'Ziyad',
'admin_last_name' => 'Parekh',
'admin_password' => '$uper$3cur3',
'country' => 'US',
'name' => 'Safepay, Inc'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.api.paylias.xyz/gateway/api/v1/csp/organization"
payload := strings.NewReader("{\n \"admin_email\": \"admin@getsafepay.com\",\n \"admin_first_name\": \"Ziyad\",\n \"admin_last_name\": \"Parekh\",\n \"admin_password\": \"$uper$3cur3\",\n \"country\": \"US\",\n \"name\": \"Safepay, Inc\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.api.paylias.xyz/gateway/api/v1/csp/organization")
.header("Content-Type", "application/json")
.body("{\n \"admin_email\": \"admin@getsafepay.com\",\n \"admin_first_name\": \"Ziyad\",\n \"admin_last_name\": \"Parekh\",\n \"admin_password\": \"$uper$3cur3\",\n \"country\": \"US\",\n \"name\": \"Safepay, Inc\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.paylias.xyz/gateway/api/v1/csp/organization")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"admin_email\": \"admin@getsafepay.com\",\n \"admin_first_name\": \"Ziyad\",\n \"admin_last_name\": \"Parekh\",\n \"admin_password\": \"$uper$3cur3\",\n \"country\": \"US\",\n \"name\": \"Safepay, Inc\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"admin_email": "admin@getsafepay.com",
"admin_first_name": "Ziyad",
"admin_last_name": "Parekh",
"country": "PK",
"enabled": true,
"name": "SafePay",
"token": "org_d09gv1s20or2svojjmt0"
},
"ok": true
}{
"code": "error.bad_request",
"message": "Invalid request parameters"
}{
"code": "error.unauthorized",
"message": "Authentication required"
}{
"code": "error.conflict",
"message": "Resource already exists"
}Organizations
Create Organization
You can create an account for an Organization through the dashboard by passing the required information to Paylias.
POST
/
api
/
v1
/
csp
/
organization
Create Organization
curl --request POST \
--url https://sandbox.api.paylias.xyz/gateway/api/v1/csp/organization \
--header 'Content-Type: application/json' \
--data '
{
"admin_email": "admin@getsafepay.com",
"admin_first_name": "Ziyad",
"admin_last_name": "Parekh",
"admin_password": "$uper$3cur3",
"country": "US",
"name": "Safepay, Inc"
}
'import requests
url = "https://sandbox.api.paylias.xyz/gateway/api/v1/csp/organization"
payload = {
"admin_email": "admin@getsafepay.com",
"admin_first_name": "Ziyad",
"admin_last_name": "Parekh",
"admin_password": "$uper$3cur3",
"country": "US",
"name": "Safepay, Inc"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
admin_email: 'admin@getsafepay.com',
admin_first_name: 'Ziyad',
admin_last_name: 'Parekh',
admin_password: '$uper$3cur3',
country: 'US',
name: 'Safepay, Inc'
})
};
fetch('https://sandbox.api.paylias.xyz/gateway/api/v1/csp/organization', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.api.paylias.xyz/gateway/api/v1/csp/organization",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'admin_email' => 'admin@getsafepay.com',
'admin_first_name' => 'Ziyad',
'admin_last_name' => 'Parekh',
'admin_password' => '$uper$3cur3',
'country' => 'US',
'name' => 'Safepay, Inc'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.api.paylias.xyz/gateway/api/v1/csp/organization"
payload := strings.NewReader("{\n \"admin_email\": \"admin@getsafepay.com\",\n \"admin_first_name\": \"Ziyad\",\n \"admin_last_name\": \"Parekh\",\n \"admin_password\": \"$uper$3cur3\",\n \"country\": \"US\",\n \"name\": \"Safepay, Inc\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.api.paylias.xyz/gateway/api/v1/csp/organization")
.header("Content-Type", "application/json")
.body("{\n \"admin_email\": \"admin@getsafepay.com\",\n \"admin_first_name\": \"Ziyad\",\n \"admin_last_name\": \"Parekh\",\n \"admin_password\": \"$uper$3cur3\",\n \"country\": \"US\",\n \"name\": \"Safepay, Inc\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.paylias.xyz/gateway/api/v1/csp/organization")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"admin_email\": \"admin@getsafepay.com\",\n \"admin_first_name\": \"Ziyad\",\n \"admin_last_name\": \"Parekh\",\n \"admin_password\": \"$uper$3cur3\",\n \"country\": \"US\",\n \"name\": \"Safepay, Inc\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"admin_email": "admin@getsafepay.com",
"admin_first_name": "Ziyad",
"admin_last_name": "Parekh",
"country": "PK",
"enabled": true,
"name": "SafePay",
"token": "org_d09gv1s20or2svojjmt0"
},
"ok": true
}{
"code": "error.bad_request",
"message": "Invalid request parameters"
}{
"code": "error.unauthorized",
"message": "Authentication required"
}{
"code": "error.conflict",
"message": "Resource already exists"
}Body
application/json
Request to create a new organization
Email of the organization admin
Example:
"admin@getsafepay.com"
First name of the organization admin
Example:
"Ziyad"
Last name of the organization admin
Example:
"Parekh"
Password for the organization admin
Example:
"mypassword"
Country code of the organization
Example:
"PK"
Name of the organization
Example:
"SafePay"
Was this page helpful?
⌘I