Agreements
Creates an agreement
Only allows creating agreements in english. Use update api to add contents in other languages
POST
/
api
/
agreements
Creates an agreement
curl --request POST \
--url https://api.fluid.app/api/agreements \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agreement": {
"title": "Terms and Conditions",
"description": "<p>By placing an order with Dunder Mifflin Paper Company you agree to these terms of sale, shipping and returns.</p>",
"show_at_checkout": true,
"default_checked": false,
"subscription_only": false,
"standalone_on_checkout": false,
"attachments_attributes": [
{
"url": "https://cdn.fluid.app/companies/1405/agreements/dunder-mifflin-terms-of-sale.pdf",
"filename": "dunder-mifflin-terms-of-sale.pdf"
}
]
}
}
'import requests
url = "https://api.fluid.app/api/agreements"
payload = { "agreement": {
"title": "Terms and Conditions",
"description": "<p>By placing an order with Dunder Mifflin Paper Company you agree to these terms of sale, shipping and returns.</p>",
"show_at_checkout": True,
"default_checked": False,
"subscription_only": False,
"standalone_on_checkout": False,
"attachments_attributes": [
{
"url": "https://cdn.fluid.app/companies/1405/agreements/dunder-mifflin-terms-of-sale.pdf",
"filename": "dunder-mifflin-terms-of-sale.pdf"
}
]
} }
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({
agreement: {
title: 'Terms and Conditions',
description: '<p>By placing an order with Dunder Mifflin Paper Company you agree to these terms of sale, shipping and returns.</p>',
show_at_checkout: true,
default_checked: false,
subscription_only: false,
standalone_on_checkout: false,
attachments_attributes: [
{
url: 'https://cdn.fluid.app/companies/1405/agreements/dunder-mifflin-terms-of-sale.pdf',
filename: 'dunder-mifflin-terms-of-sale.pdf'
}
]
}
})
};
fetch('https://api.fluid.app/api/agreements', 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/agreements",
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([
'agreement' => [
'title' => 'Terms and Conditions',
'description' => '<p>By placing an order with Dunder Mifflin Paper Company you agree to these terms of sale, shipping and returns.</p>',
'show_at_checkout' => true,
'default_checked' => false,
'subscription_only' => false,
'standalone_on_checkout' => false,
'attachments_attributes' => [
[
'url' => 'https://cdn.fluid.app/companies/1405/agreements/dunder-mifflin-terms-of-sale.pdf',
'filename' => 'dunder-mifflin-terms-of-sale.pdf'
]
]
]
]),
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/agreements"
payload := strings.NewReader("{\n \"agreement\": {\n \"title\": \"Terms and Conditions\",\n \"description\": \"<p>By placing an order with Dunder Mifflin Paper Company you agree to these terms of sale, shipping and returns.</p>\",\n \"show_at_checkout\": true,\n \"default_checked\": false,\n \"subscription_only\": false,\n \"standalone_on_checkout\": false,\n \"attachments_attributes\": [\n {\n \"url\": \"https://cdn.fluid.app/companies/1405/agreements/dunder-mifflin-terms-of-sale.pdf\",\n \"filename\": \"dunder-mifflin-terms-of-sale.pdf\"\n }\n ]\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/agreements")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agreement\": {\n \"title\": \"Terms and Conditions\",\n \"description\": \"<p>By placing an order with Dunder Mifflin Paper Company you agree to these terms of sale, shipping and returns.</p>\",\n \"show_at_checkout\": true,\n \"default_checked\": false,\n \"subscription_only\": false,\n \"standalone_on_checkout\": false,\n \"attachments_attributes\": [\n {\n \"url\": \"https://cdn.fluid.app/companies/1405/agreements/dunder-mifflin-terms-of-sale.pdf\",\n \"filename\": \"dunder-mifflin-terms-of-sale.pdf\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/agreements")
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 \"agreement\": {\n \"title\": \"Terms and Conditions\",\n \"description\": \"<p>By placing an order with Dunder Mifflin Paper Company you agree to these terms of sale, shipping and returns.</p>\",\n \"show_at_checkout\": true,\n \"default_checked\": false,\n \"subscription_only\": false,\n \"standalone_on_checkout\": false,\n \"attachments_attributes\": [\n {\n \"url\": \"https://cdn.fluid.app/companies/1405/agreements/dunder-mifflin-terms-of-sale.pdf\",\n \"filename\": \"dunder-mifflin-terms-of-sale.pdf\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"agreement": {
"id": 48213,
"title": "Terms and Conditions",
"active": true,
"show_at_checkout": true,
"default_checked": false,
"required_on_checkout": false,
"subscription_only": false,
"standalone_on_checkout": false,
"content_digest": "4f7f9a2d0c6b1e8e3a5d9c7b2f1e0d4c8b6a5f3e2d1c0b9a8f7e6d5c4b3a2918",
"company_country_ids": [],
"description": "<p>By placing an order with Dunder Mifflin Paper Company you agree to these terms of sale, shipping and returns.</p>",
"show_path": "/api/agreements/48213",
"language_iso": "en",
"required": false,
"enrollment_pack_id": null,
"created_at": "2026-09-14T15:22:08Z",
"updated_at": "2026-09-14T15:22:08Z",
"company_logo": "https://cdn.fluid.app/companies/1405/logo/dunder-mifflin-logo.png",
"attachments": []
},
"meta": {
"request_id": "7f3c2a91-5d4e-4b8a-9c61-2e8f0d3b5a47",
"timestamp": "2026-09-22T14:05:31Z"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"code": "<string>",
"blocked_date": "2026-11-30",
"blocked_day": 30,
"allowed_date": "2026-11-28",
"scheduled_date": "2026-12-10",
"last_bill_date": "2026-11-10",
"requested_date": "2026-11-30",
"payment_uuid": "<string>",
"error_details": [
{
"code": "<string>",
"field": "<string>",
"payment": "not_attempted",
"message": "<string>"
}
],
"coded_recovery": true
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"code": "<string>",
"blocked_date": "2026-11-30",
"blocked_day": 30,
"allowed_date": "2026-11-28",
"scheduled_date": "2026-12-10",
"last_bill_date": "2026-11-10",
"requested_date": "2026-11-30",
"payment_uuid": "<string>",
"error_details": [
{
"code": "<string>",
"field": "<string>",
"payment": "not_attempted",
"message": "<string>"
}
],
"coded_recovery": true
}
}Headers
Optional client-chosen key, 1 to 255 characters with at least one that is not whitespace; a blank key answers 422. A retry of the same request with the same key from the same company answers with the record the first request created instead of creating another, even when the first response was lost. The same key sent with a different request, or by a different user or credential, answers 422.
Required string length:
1 - 255Pattern:
\S⌘I
Creates an agreement
curl --request POST \
--url https://api.fluid.app/api/agreements \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agreement": {
"title": "Terms and Conditions",
"description": "<p>By placing an order with Dunder Mifflin Paper Company you agree to these terms of sale, shipping and returns.</p>",
"show_at_checkout": true,
"default_checked": false,
"subscription_only": false,
"standalone_on_checkout": false,
"attachments_attributes": [
{
"url": "https://cdn.fluid.app/companies/1405/agreements/dunder-mifflin-terms-of-sale.pdf",
"filename": "dunder-mifflin-terms-of-sale.pdf"
}
]
}
}
'import requests
url = "https://api.fluid.app/api/agreements"
payload = { "agreement": {
"title": "Terms and Conditions",
"description": "<p>By placing an order with Dunder Mifflin Paper Company you agree to these terms of sale, shipping and returns.</p>",
"show_at_checkout": True,
"default_checked": False,
"subscription_only": False,
"standalone_on_checkout": False,
"attachments_attributes": [
{
"url": "https://cdn.fluid.app/companies/1405/agreements/dunder-mifflin-terms-of-sale.pdf",
"filename": "dunder-mifflin-terms-of-sale.pdf"
}
]
} }
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({
agreement: {
title: 'Terms and Conditions',
description: '<p>By placing an order with Dunder Mifflin Paper Company you agree to these terms of sale, shipping and returns.</p>',
show_at_checkout: true,
default_checked: false,
subscription_only: false,
standalone_on_checkout: false,
attachments_attributes: [
{
url: 'https://cdn.fluid.app/companies/1405/agreements/dunder-mifflin-terms-of-sale.pdf',
filename: 'dunder-mifflin-terms-of-sale.pdf'
}
]
}
})
};
fetch('https://api.fluid.app/api/agreements', 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/agreements",
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([
'agreement' => [
'title' => 'Terms and Conditions',
'description' => '<p>By placing an order with Dunder Mifflin Paper Company you agree to these terms of sale, shipping and returns.</p>',
'show_at_checkout' => true,
'default_checked' => false,
'subscription_only' => false,
'standalone_on_checkout' => false,
'attachments_attributes' => [
[
'url' => 'https://cdn.fluid.app/companies/1405/agreements/dunder-mifflin-terms-of-sale.pdf',
'filename' => 'dunder-mifflin-terms-of-sale.pdf'
]
]
]
]),
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/agreements"
payload := strings.NewReader("{\n \"agreement\": {\n \"title\": \"Terms and Conditions\",\n \"description\": \"<p>By placing an order with Dunder Mifflin Paper Company you agree to these terms of sale, shipping and returns.</p>\",\n \"show_at_checkout\": true,\n \"default_checked\": false,\n \"subscription_only\": false,\n \"standalone_on_checkout\": false,\n \"attachments_attributes\": [\n {\n \"url\": \"https://cdn.fluid.app/companies/1405/agreements/dunder-mifflin-terms-of-sale.pdf\",\n \"filename\": \"dunder-mifflin-terms-of-sale.pdf\"\n }\n ]\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/agreements")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agreement\": {\n \"title\": \"Terms and Conditions\",\n \"description\": \"<p>By placing an order with Dunder Mifflin Paper Company you agree to these terms of sale, shipping and returns.</p>\",\n \"show_at_checkout\": true,\n \"default_checked\": false,\n \"subscription_only\": false,\n \"standalone_on_checkout\": false,\n \"attachments_attributes\": [\n {\n \"url\": \"https://cdn.fluid.app/companies/1405/agreements/dunder-mifflin-terms-of-sale.pdf\",\n \"filename\": \"dunder-mifflin-terms-of-sale.pdf\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/agreements")
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 \"agreement\": {\n \"title\": \"Terms and Conditions\",\n \"description\": \"<p>By placing an order with Dunder Mifflin Paper Company you agree to these terms of sale, shipping and returns.</p>\",\n \"show_at_checkout\": true,\n \"default_checked\": false,\n \"subscription_only\": false,\n \"standalone_on_checkout\": false,\n \"attachments_attributes\": [\n {\n \"url\": \"https://cdn.fluid.app/companies/1405/agreements/dunder-mifflin-terms-of-sale.pdf\",\n \"filename\": \"dunder-mifflin-terms-of-sale.pdf\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"agreement": {
"id": 48213,
"title": "Terms and Conditions",
"active": true,
"show_at_checkout": true,
"default_checked": false,
"required_on_checkout": false,
"subscription_only": false,
"standalone_on_checkout": false,
"content_digest": "4f7f9a2d0c6b1e8e3a5d9c7b2f1e0d4c8b6a5f3e2d1c0b9a8f7e6d5c4b3a2918",
"company_country_ids": [],
"description": "<p>By placing an order with Dunder Mifflin Paper Company you agree to these terms of sale, shipping and returns.</p>",
"show_path": "/api/agreements/48213",
"language_iso": "en",
"required": false,
"enrollment_pack_id": null,
"created_at": "2026-09-14T15:22:08Z",
"updated_at": "2026-09-14T15:22:08Z",
"company_logo": "https://cdn.fluid.app/companies/1405/logo/dunder-mifflin-logo.png",
"attachments": []
},
"meta": {
"request_id": "7f3c2a91-5d4e-4b8a-9c61-2e8f0d3b5a47",
"timestamp": "2026-09-22T14:05:31Z"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"code": "<string>",
"blocked_date": "2026-11-30",
"blocked_day": 30,
"allowed_date": "2026-11-28",
"scheduled_date": "2026-12-10",
"last_bill_date": "2026-11-10",
"requested_date": "2026-11-30",
"payment_uuid": "<string>",
"error_details": [
{
"code": "<string>",
"field": "<string>",
"payment": "not_attempted",
"message": "<string>"
}
],
"coded_recovery": true
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"code": "<string>",
"blocked_date": "2026-11-30",
"blocked_day": 30,
"allowed_date": "2026-11-28",
"scheduled_date": "2026-12-10",
"last_bill_date": "2026-11-10",
"requested_date": "2026-11-30",
"payment_uuid": "<string>",
"error_details": [
{
"code": "<string>",
"field": "<string>",
"payment": "not_attempted",
"message": "<string>"
}
],
"coded_recovery": true
}
}