Update counter
curl --request PUT \
--url http://api-sandbox.fexpayments.com/merchant/api/v1/counters/{counterID} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Counter 1 (updated)",
"location": "Ground Floor, Register 1",
"webhook_url": "https://pos.example.com/webhooks/v2/payments"
}
'import requests
url = "http://api-sandbox.fexpayments.com/merchant/api/v1/counters/{counterID}"
payload = {
"name": "Counter 1 (updated)",
"location": "Ground Floor, Register 1",
"webhook_url": "https://pos.example.com/webhooks/v2/payments"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Counter 1 (updated)',
location: 'Ground Floor, Register 1',
webhook_url: 'https://pos.example.com/webhooks/v2/payments'
})
};
fetch('http://api-sandbox.fexpayments.com/merchant/api/v1/counters/{counterID}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Counter 1 (updated)',
'location' => 'Ground Floor, Register 1',
'webhook_url' => 'https://pos.example.com/webhooks/v2/payments'
]),
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/counters/{counterID}"
payload := strings.NewReader("{\n \"name\": \"Counter 1 (updated)\",\n \"location\": \"Ground Floor, Register 1\",\n \"webhook_url\": \"https://pos.example.com/webhooks/v2/payments\"\n}")
req, _ := http.NewRequest("PUT", 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.put("http://api-sandbox.fexpayments.com/merchant/api/v1/counters/{counterID}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Counter 1 (updated)\",\n \"location\": \"Ground Floor, Register 1\",\n \"webhook_url\": \"https://pos.example.com/webhooks/v2/payments\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://api-sandbox.fexpayments.com/merchant/api/v1/counters/{counterID}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Counter 1 (updated)\",\n \"location\": \"Ground Floor, Register 1\",\n \"webhook_url\": \"https://pos.example.com/webhooks/v2/payments\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"counter": {
"id": "c1d2e3f4-a5b6-7890-abcd-ef1234567890",
"merchant_id": "74815c83-e47b-4dc5-aefe-abe4484dd280",
"name": "Counter 1",
"status": "active",
"location": "Floor 2, Register 3",
"keycloak_client_id": "counter-c1d2e3f4-a5b6-7890-abcd-ef1234567890",
"webhook_url": "https://pos.example.com/webhooks/payments",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": "Amount must be greater than 0"
}{
"success": false,
"error": "Unauthorized"
}{
"success": false,
"error": "Payment intent not found"
}Counters
Update counter
Update counter name, location, or webhook URL.
PUT
/
merchant
/
api
/
v1
/
counters
/
{counterID}
Update counter
curl --request PUT \
--url http://api-sandbox.fexpayments.com/merchant/api/v1/counters/{counterID} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Counter 1 (updated)",
"location": "Ground Floor, Register 1",
"webhook_url": "https://pos.example.com/webhooks/v2/payments"
}
'import requests
url = "http://api-sandbox.fexpayments.com/merchant/api/v1/counters/{counterID}"
payload = {
"name": "Counter 1 (updated)",
"location": "Ground Floor, Register 1",
"webhook_url": "https://pos.example.com/webhooks/v2/payments"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Counter 1 (updated)',
location: 'Ground Floor, Register 1',
webhook_url: 'https://pos.example.com/webhooks/v2/payments'
})
};
fetch('http://api-sandbox.fexpayments.com/merchant/api/v1/counters/{counterID}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Counter 1 (updated)',
'location' => 'Ground Floor, Register 1',
'webhook_url' => 'https://pos.example.com/webhooks/v2/payments'
]),
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/counters/{counterID}"
payload := strings.NewReader("{\n \"name\": \"Counter 1 (updated)\",\n \"location\": \"Ground Floor, Register 1\",\n \"webhook_url\": \"https://pos.example.com/webhooks/v2/payments\"\n}")
req, _ := http.NewRequest("PUT", 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.put("http://api-sandbox.fexpayments.com/merchant/api/v1/counters/{counterID}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Counter 1 (updated)\",\n \"location\": \"Ground Floor, Register 1\",\n \"webhook_url\": \"https://pos.example.com/webhooks/v2/payments\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://api-sandbox.fexpayments.com/merchant/api/v1/counters/{counterID}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Counter 1 (updated)\",\n \"location\": \"Ground Floor, Register 1\",\n \"webhook_url\": \"https://pos.example.com/webhooks/v2/payments\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"counter": {
"id": "c1d2e3f4-a5b6-7890-abcd-ef1234567890",
"merchant_id": "74815c83-e47b-4dc5-aefe-abe4484dd280",
"name": "Counter 1",
"status": "active",
"location": "Floor 2, Register 3",
"keycloak_client_id": "counter-c1d2e3f4-a5b6-7890-abcd-ef1234567890",
"webhook_url": "https://pos.example.com/webhooks/payments",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": "Amount must be greater than 0"
}{
"success": false,
"error": "Unauthorized"
}{
"success": false,
"error": "Payment intent not found"
}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
Body
application/json
⌘I
