Callbacks
Create a callback registration
Registers a synchronous callback for the company against a callback definition,
so Fluid can call the given url for decisions such as tax or shipping.
definition_name and url are required. Returns 201 with the created
registration; 422 when the body fails validation; 409 when a registration
for this definition already exists for the owner. Requires a company Bearer
token (401 otherwise).
POST
/
api
/
callback
/
registrations
Create a callback registration
curl --request POST \
--url https://api.fluid.app/api/callback/registrations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"callback_registration": {
"definition_name": "update_cart_tax",
"url": "https://tax.dundermifflin.com/fluid/callbacks/cart-tax",
"active": true,
"country_codes": [
"US"
],
"points_format": "whole"
}
}
'import requests
url = "https://api.fluid.app/api/callback/registrations"
payload = { "callback_registration": {
"definition_name": "update_cart_tax",
"url": "https://tax.dundermifflin.com/fluid/callbacks/cart-tax",
"active": True,
"country_codes": ["US"],
"points_format": "whole"
} }
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({
callback_registration: {
definition_name: 'update_cart_tax',
url: 'https://tax.dundermifflin.com/fluid/callbacks/cart-tax',
active: true,
country_codes: ['US'],
points_format: 'whole'
}
})
};
fetch('https://api.fluid.app/api/callback/registrations', 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://api.fluid.app/api/callback/registrations",
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([
'callback_registration' => [
'definition_name' => 'update_cart_tax',
'url' => 'https://tax.dundermifflin.com/fluid/callbacks/cart-tax',
'active' => true,
'country_codes' => [
'US'
],
'points_format' => 'whole'
]
]),
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 := "https://api.fluid.app/api/callback/registrations"
payload := strings.NewReader("{\n \"callback_registration\": {\n \"definition_name\": \"update_cart_tax\",\n \"url\": \"https://tax.dundermifflin.com/fluid/callbacks/cart-tax\",\n \"active\": true,\n \"country_codes\": [\n \"US\"\n ],\n \"points_format\": \"whole\"\n }\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("https://api.fluid.app/api/callback/registrations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"callback_registration\": {\n \"definition_name\": \"update_cart_tax\",\n \"url\": \"https://tax.dundermifflin.com/fluid/callbacks/cart-tax\",\n \"active\": true,\n \"country_codes\": [\n \"US\"\n ],\n \"points_format\": \"whole\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/callback/registrations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"callback_registration\": {\n \"definition_name\": \"update_cart_tax\",\n \"url\": \"https://tax.dundermifflin.com/fluid/callbacks/cart-tax\",\n \"active\": true,\n \"country_codes\": [\n \"US\"\n ],\n \"points_format\": \"whole\"\n }\n}"
response = http.request(request)
puts response.read_body{
"callback_registration": {
"uuid": "cbr_7fk2m9qxw4hz8tnp3vbd6yjc1rls5ega",
"definition_name": "update_cart_tax",
"url": "https://tax.dundermifflin.com/fluid/callbacks/cart-tax",
"active": true,
"country_codes": [
"US"
],
"verification_token": "cvt_R8vK2mQp9sXw4Lz7NbT1yHc6FdJ3gE0a",
"created_at": "2026-09-14T15:22:08.412Z"
},
"meta": {
"request_id": "8f3c2b71-5d4e-4a9b-b6f0-1e7a9c3d2f58",
"timestamp": "2026-09-30T14:05:12Z"
}
}{
"message": "<string>"
}{
"message": "<string>",
"error": "<string>"
}{
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}⌘I
Create a callback registration
curl --request POST \
--url https://api.fluid.app/api/callback/registrations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"callback_registration": {
"definition_name": "update_cart_tax",
"url": "https://tax.dundermifflin.com/fluid/callbacks/cart-tax",
"active": true,
"country_codes": [
"US"
],
"points_format": "whole"
}
}
'import requests
url = "https://api.fluid.app/api/callback/registrations"
payload = { "callback_registration": {
"definition_name": "update_cart_tax",
"url": "https://tax.dundermifflin.com/fluid/callbacks/cart-tax",
"active": True,
"country_codes": ["US"],
"points_format": "whole"
} }
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({
callback_registration: {
definition_name: 'update_cart_tax',
url: 'https://tax.dundermifflin.com/fluid/callbacks/cart-tax',
active: true,
country_codes: ['US'],
points_format: 'whole'
}
})
};
fetch('https://api.fluid.app/api/callback/registrations', 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://api.fluid.app/api/callback/registrations",
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([
'callback_registration' => [
'definition_name' => 'update_cart_tax',
'url' => 'https://tax.dundermifflin.com/fluid/callbacks/cart-tax',
'active' => true,
'country_codes' => [
'US'
],
'points_format' => 'whole'
]
]),
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 := "https://api.fluid.app/api/callback/registrations"
payload := strings.NewReader("{\n \"callback_registration\": {\n \"definition_name\": \"update_cart_tax\",\n \"url\": \"https://tax.dundermifflin.com/fluid/callbacks/cart-tax\",\n \"active\": true,\n \"country_codes\": [\n \"US\"\n ],\n \"points_format\": \"whole\"\n }\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("https://api.fluid.app/api/callback/registrations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"callback_registration\": {\n \"definition_name\": \"update_cart_tax\",\n \"url\": \"https://tax.dundermifflin.com/fluid/callbacks/cart-tax\",\n \"active\": true,\n \"country_codes\": [\n \"US\"\n ],\n \"points_format\": \"whole\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/callback/registrations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"callback_registration\": {\n \"definition_name\": \"update_cart_tax\",\n \"url\": \"https://tax.dundermifflin.com/fluid/callbacks/cart-tax\",\n \"active\": true,\n \"country_codes\": [\n \"US\"\n ],\n \"points_format\": \"whole\"\n }\n}"
response = http.request(request)
puts response.read_body{
"callback_registration": {
"uuid": "cbr_7fk2m9qxw4hz8tnp3vbd6yjc1rls5ega",
"definition_name": "update_cart_tax",
"url": "https://tax.dundermifflin.com/fluid/callbacks/cart-tax",
"active": true,
"country_codes": [
"US"
],
"verification_token": "cvt_R8vK2mQp9sXw4Lz7NbT1yHc6FdJ3gE0a",
"created_at": "2026-09-14T15:22:08.412Z"
},
"meta": {
"request_id": "8f3c2b71-5d4e-4a9b-b6f0-1e7a9c3d2f58",
"timestamp": "2026-09-30T14:05:12Z"
}
}{
"message": "<string>"
}{
"message": "<string>",
"error": "<string>"
}{
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}