Rotate webhook secret
curl --request POST \
--url http://api-sandbox.fexpayments.com/merchant/api/v1/counters/{counterID}/rotate-secret \
--header 'Authorization: Bearer <token>'import requests
url = "http://api-sandbox.fexpayments.com/merchant/api/v1/counters/{counterID}/rotate-secret"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('http://api-sandbox.fexpayments.com/merchant/api/v1/counters/{counterID}/rotate-secret', 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/counters/{counterID}/rotate-secret",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://api-sandbox.fexpayments.com/merchant/api/v1/counters/{counterID}/rotate-secret"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/counters/{counterID}/rotate-secret")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://api-sandbox.fexpayments.com/merchant/api/v1/counters/{counterID}/rotate-secret")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"webhook_secret": "a3f8c2e1d4b7a9f0e2c5b8d1a4f7c0e3d6b9a2f5c8e1d4b7a0f3c6e9d2b5a8f1",
"note": "Update your webhook handler immediately — the old secret is no longer valid."
}{
"success": false,
"error": "Unauthorized"
}{
"success": false,
"error": "Payment intent not found"
}{
"success": false,
"error": "Failed to create payment intent"
}Counters
Rotate webhook secret
Generate a new HMAC signing secret for the counter’s webhook. The old secret is immediately invalidated — update your webhook handler before calling this.
POST
/
merchant
/
api
/
v1
/
counters
/
{counterID}
/
rotate-secret
Rotate webhook secret
curl --request POST \
--url http://api-sandbox.fexpayments.com/merchant/api/v1/counters/{counterID}/rotate-secret \
--header 'Authorization: Bearer <token>'import requests
url = "http://api-sandbox.fexpayments.com/merchant/api/v1/counters/{counterID}/rotate-secret"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('http://api-sandbox.fexpayments.com/merchant/api/v1/counters/{counterID}/rotate-secret', 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/counters/{counterID}/rotate-secret",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://api-sandbox.fexpayments.com/merchant/api/v1/counters/{counterID}/rotate-secret"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/counters/{counterID}/rotate-secret")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://api-sandbox.fexpayments.com/merchant/api/v1/counters/{counterID}/rotate-secret")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"webhook_secret": "a3f8c2e1d4b7a9f0e2c5b8d1a4f7c0e3d6b9a2f5c8e1d4b7a0f3c6e9d2b5a8f1",
"note": "Update your webhook handler immediately — the old secret is no longer valid."
}{
"success": false,
"error": "Unauthorized"
}{
"success": false,
"error": "Payment intent not found"
}{
"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.
Path Parameters
Counter ID
Response
New webhook secret generated
