Country templates
Add a country template to a resource
Gives the resource a template of the theme as a country template. The template must be tagged with at least one country, be for the resource’s type, and share no country with another country template the resource holds in the theme. Adding a template the resource already holds returns it unchanged. The resource’s main template is not changed. Requires theme update permission.
POST
/
api
/
v202604
/
themes
/
{theme_id}
/
country-templates
Add a country template to a resource
curl --request POST \
--url https://api.fluid.app/api/v202604/themes/{theme_id}/country-templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"resource_type": "Product",
"resource_id": 30117,
"template_id": 902377
}
'import requests
url = "https://api.fluid.app/api/v202604/themes/{theme_id}/country-templates"
payload = {
"resource_type": "Product",
"resource_id": 30117,
"template_id": 902377
}
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({resource_type: 'Product', resource_id: 30117, template_id: 902377})
};
fetch('https://api.fluid.app/api/v202604/themes/{theme_id}/country-templates', 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/v202604/themes/{theme_id}/country-templates",
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([
'resource_type' => 'Product',
'resource_id' => 30117,
'template_id' => 902377
]),
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/v202604/themes/{theme_id}/country-templates"
payload := strings.NewReader("{\n \"resource_type\": \"Product\",\n \"resource_id\": 30117,\n \"template_id\": 902377\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/v202604/themes/{theme_id}/country-templates")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"resource_type\": \"Product\",\n \"resource_id\": 30117,\n \"template_id\": 902377\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/v202604/themes/{theme_id}/country-templates")
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 \"resource_type\": \"Product\",\n \"resource_id\": 30117,\n \"template_id\": 902377\n}"
response = http.request(request)
puts response.read_body{
"country_template": {
"template_id": 902377,
"template_name": "Mexico Product",
"themeable_type": "product",
"country_ids": [
142
]
},
"status": 201,
"meta": {
"request_uuid": "4d8e1b63-7a2c-4f95-8e07-c3b6a9d2f150",
"timestamp": "2026-11-19T16:41:12Z"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"error": {
"message": "<string>",
"details": {
"type": "not_found",
"template_id": 123,
"country_ids": [
123
]
}
},
"status": 123,
"meta": {
"request_uuid": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"message": "<string>",
"details": {
"type": "not_found",
"template_id": 123,
"country_ids": [
123
]
}
},
"status": 123,
"meta": {
"request_uuid": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}Authorizations
Path Parameters
Body
application/json
⌘I
Add a country template to a resource
curl --request POST \
--url https://api.fluid.app/api/v202604/themes/{theme_id}/country-templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"resource_type": "Product",
"resource_id": 30117,
"template_id": 902377
}
'import requests
url = "https://api.fluid.app/api/v202604/themes/{theme_id}/country-templates"
payload = {
"resource_type": "Product",
"resource_id": 30117,
"template_id": 902377
}
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({resource_type: 'Product', resource_id: 30117, template_id: 902377})
};
fetch('https://api.fluid.app/api/v202604/themes/{theme_id}/country-templates', 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/v202604/themes/{theme_id}/country-templates",
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([
'resource_type' => 'Product',
'resource_id' => 30117,
'template_id' => 902377
]),
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/v202604/themes/{theme_id}/country-templates"
payload := strings.NewReader("{\n \"resource_type\": \"Product\",\n \"resource_id\": 30117,\n \"template_id\": 902377\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/v202604/themes/{theme_id}/country-templates")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"resource_type\": \"Product\",\n \"resource_id\": 30117,\n \"template_id\": 902377\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/v202604/themes/{theme_id}/country-templates")
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 \"resource_type\": \"Product\",\n \"resource_id\": 30117,\n \"template_id\": 902377\n}"
response = http.request(request)
puts response.read_body{
"country_template": {
"template_id": 902377,
"template_name": "Mexico Product",
"themeable_type": "product",
"country_ids": [
142
]
},
"status": 201,
"meta": {
"request_uuid": "4d8e1b63-7a2c-4f95-8e07-c3b6a9d2f150",
"timestamp": "2026-11-19T16:41:12Z"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"error": {
"message": "<string>",
"details": {
"type": "not_found",
"template_id": 123,
"country_ids": [
123
]
}
},
"status": 123,
"meta": {
"request_uuid": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"message": "<string>",
"details": {
"type": "not_found",
"template_id": 123,
"country_ids": [
123
]
}
},
"status": 123,
"meta": {
"request_uuid": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}