Create Namespace
curl --request POST \
--url https://sandbox.api.paylias.xyz/gateway/api/v1/csp/partner \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'idempotency-key: <idempotency-key>' \
--data '
{
"domain": "safepay",
"name": "Safepay Core Domain"
}
'import requests
url = "https://sandbox.api.paylias.xyz/gateway/api/v1/csp/partner"
payload = {
"domain": "safepay",
"name": "Safepay Core Domain"
}
headers = {
"idempotency-key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'idempotency-key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({domain: 'safepay', name: 'Safepay Core Domain'})
};
fetch('https://sandbox.api.paylias.xyz/gateway/api/v1/csp/partner', 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/partner",
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([
'domain' => 'safepay',
'name' => 'Safepay Core Domain'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"idempotency-key: <idempotency-key>"
],
]);
$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/partner"
payload := strings.NewReader("{\n \"domain\": \"safepay\",\n \"name\": \"Safepay Core Domain\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("idempotency-key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
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/partner")
.header("idempotency-key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"domain\": \"safepay\",\n \"name\": \"Safepay Core Domain\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.paylias.xyz/gateway/api/v1/csp/partner")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["idempotency-key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"domain\": \"safepay\",\n \"name\": \"Safepay Core Domain\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"created_at": {
"seconds": 1635784800
},
"domain": "example-partner.com",
"name": "Example Partner",
"org_id": "org_12345abcde",
"token": "partner_67890fghij",
"updated_at": {
"seconds": 1635788400
}
},
"ok": true
}{
"code": "error.bad_request",
"message": "Invalid request parameters"
}{
"code": "error.unauthorized",
"message": "Authentication required"
}{
"code": "error.conflict",
"message": "Resource already exists"
}Namespace
Create Namespace
You can create a Namespace for an Organization through the dashboard by passing the required information to Paylias.
The domain must be a string that conforms to this regexp `^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+$` and must be at a minimum 2 characters long and at a maximum 100 characters long
The name must be a string that is at a minimum 2 characters long and at a maximum 100 characters long
POST
/
api
/
v1
/
csp
/
partner
Create Namespace
curl --request POST \
--url https://sandbox.api.paylias.xyz/gateway/api/v1/csp/partner \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'idempotency-key: <idempotency-key>' \
--data '
{
"domain": "safepay",
"name": "Safepay Core Domain"
}
'import requests
url = "https://sandbox.api.paylias.xyz/gateway/api/v1/csp/partner"
payload = {
"domain": "safepay",
"name": "Safepay Core Domain"
}
headers = {
"idempotency-key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'idempotency-key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({domain: 'safepay', name: 'Safepay Core Domain'})
};
fetch('https://sandbox.api.paylias.xyz/gateway/api/v1/csp/partner', 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/partner",
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([
'domain' => 'safepay',
'name' => 'Safepay Core Domain'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"idempotency-key: <idempotency-key>"
],
]);
$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/partner"
payload := strings.NewReader("{\n \"domain\": \"safepay\",\n \"name\": \"Safepay Core Domain\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("idempotency-key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
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/partner")
.header("idempotency-key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"domain\": \"safepay\",\n \"name\": \"Safepay Core Domain\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.paylias.xyz/gateway/api/v1/csp/partner")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["idempotency-key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"domain\": \"safepay\",\n \"name\": \"Safepay Core Domain\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"created_at": {
"seconds": 1635784800
},
"domain": "example-partner.com",
"name": "Example Partner",
"org_id": "org_12345abcde",
"token": "partner_67890fghij",
"updated_at": {
"seconds": 1635788400
}
},
"ok": true
}{
"code": "error.bad_request",
"message": "Invalid request parameters"
}{
"code": "error.unauthorized",
"message": "Authentication required"
}{
"code": "error.conflict",
"message": "Resource already exists"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
The Idempotency Key - usually a UUID
Body
application/json
Request to create a new partner
Was this page helpful?
⌘I