curl --request POST \
--url http://api-sandbox.fexpayments.com/merchant/api/v1/register \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "shop@example.com",
"business_name": "My Shop"
}
'import requests
url = "http://api-sandbox.fexpayments.com/merchant/api/v1/register"
payload = {
"email": "shop@example.com",
"business_name": "My Shop"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: 'shop@example.com', business_name: 'My Shop'})
};
fetch('http://api-sandbox.fexpayments.com/merchant/api/v1/register', 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 => "http://api-sandbox.fexpayments.com/merchant/api/v1/register",
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([
'email' => 'shop@example.com',
'business_name' => 'My Shop'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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 := "http://api-sandbox.fexpayments.com/merchant/api/v1/register"
payload := strings.NewReader("{\n \"email\": \"shop@example.com\",\n \"business_name\": \"My Shop\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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("http://api-sandbox.fexpayments.com/merchant/api/v1/register")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"shop@example.com\",\n \"business_name\": \"My Shop\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://api-sandbox.fexpayments.com/merchant/api/v1/register")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"shop@example.com\",\n \"business_name\": \"My Shop\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"merchant_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"client_id": "merchant-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"client_secret": "s3cr3t-shown-once",
"note": "Store client_secret securely — it will not be shown again."
}{
"success": false,
"error": "Amount must be greater than 0"
}{
"success": false,
"error": "Failed to create payment intent"
}Register a new merchant
Creates a merchant account and provisions a Keycloak client_credentials client. Returns client_id and client_secret — the secret is shown only once. POS terminals authenticate using these credentials via Keycloak’s token endpoint. Requires platform admin JWT (realm role admin).
curl --request POST \
--url http://api-sandbox.fexpayments.com/merchant/api/v1/register \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "shop@example.com",
"business_name": "My Shop"
}
'import requests
url = "http://api-sandbox.fexpayments.com/merchant/api/v1/register"
payload = {
"email": "shop@example.com",
"business_name": "My Shop"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: 'shop@example.com', business_name: 'My Shop'})
};
fetch('http://api-sandbox.fexpayments.com/merchant/api/v1/register', 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 => "http://api-sandbox.fexpayments.com/merchant/api/v1/register",
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([
'email' => 'shop@example.com',
'business_name' => 'My Shop'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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 := "http://api-sandbox.fexpayments.com/merchant/api/v1/register"
payload := strings.NewReader("{\n \"email\": \"shop@example.com\",\n \"business_name\": \"My Shop\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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("http://api-sandbox.fexpayments.com/merchant/api/v1/register")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"shop@example.com\",\n \"business_name\": \"My Shop\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://api-sandbox.fexpayments.com/merchant/api/v1/register")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"shop@example.com\",\n \"business_name\": \"My Shop\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"merchant_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"client_id": "merchant-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"client_secret": "s3cr3t-shown-once",
"note": "Store client_secret securely — it will not be shown again."
}{
"success": false,
"error": "Amount must be greater than 0"
}{
"success": false,
"error": "Failed to create payment intent"
}Authorizations
Keycloak JWT. Roles: admin (platform admin — can register merchants, act on behalf of any merchant), merchant (dashboard user — scoped to their own merchant_id via user attribute mapper), POS terminals use client credentials flow with merchant_id injected via protocol mapper.
Body
Response
Merchant registered — store client_secret securely
true
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
"merchant-a1b2c3d4-e5f6-7890-abcd-ef1234567890"
Shown only once — store securely.
"s3cr3t-shown-once"
"Store client_secret securely — it will not be shown again."
