Subscriptions
Attach subscription discount
Attaches a discount to the subscription {token}, by discount_id or
discount_code, optionally scoped by duration/duration_cycles.
Requires a droplet token or an admin’s bearer token; an admin also needs
the subscriptions.update permission. Returns 422 on validation
failure, 403 when not permitted, 404 when the subscription is not
found, and 401 when unauthenticated.
POST
/
api
/
checkout
/
v2026-04
/
subscriptions
/
{token}
/
discounts
Attach subscription discount
curl --request POST \
--url https://api.fluid.app/api/checkout/v2026-04/subscriptions/{token}/discounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"discount_code": "SCRANTON5",
"duration": "once",
"notes": "Welcome back offer"
}
'import requests
url = "https://api.fluid.app/api/checkout/v2026-04/subscriptions/{token}/discounts"
payload = {
"discount_code": "SCRANTON5",
"duration": "once",
"notes": "Welcome back offer"
}
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({discount_code: 'SCRANTON5', duration: 'once', notes: 'Welcome back offer'})
};
fetch('https://api.fluid.app/api/checkout/v2026-04/subscriptions/{token}/discounts', 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/checkout/v2026-04/subscriptions/{token}/discounts",
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([
'discount_code' => 'SCRANTON5',
'duration' => 'once',
'notes' => 'Welcome back offer'
]),
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/checkout/v2026-04/subscriptions/{token}/discounts"
payload := strings.NewReader("{\n \"discount_code\": \"SCRANTON5\",\n \"duration\": \"once\",\n \"notes\": \"Welcome back offer\"\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/checkout/v2026-04/subscriptions/{token}/discounts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"discount_code\": \"SCRANTON5\",\n \"duration\": \"once\",\n \"notes\": \"Welcome back offer\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/checkout/v2026-04/subscriptions/{token}/discounts")
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 \"discount_code\": \"SCRANTON5\",\n \"duration\": \"once\",\n \"notes\": \"Welcome back offer\"\n}"
response = http.request(request)
puts response.read_body{
"subscription_discount": {
"id": 6254,
"company_id": 1405,
"subscription_id": 48213,
"discount_id": 1977,
"discount_version_id": 2461,
"attached_by_member_id": "9c41e7b2-3a5d-4f18-8e6c-2b7d0a9f4c13",
"attached_by_droplet_installation_id": null,
"duration": "once",
"duration_cycles": null,
"applied_cycles": 0,
"removed_reason": null,
"removed_detail": null,
"attached_via": "manual_member",
"notes": "Welcome back offer",
"starts_at": "2026-09-30T15:30:12Z",
"removed_at": null,
"created_at": "2026-09-30T15:30:12Z",
"updated_at": "2026-09-30T15:30:12Z",
"discount": {
"id": 1977,
"code": "SCRANTON5"
},
"discount_version": {
"id": 2461,
"version_number": 2,
"code": "SCRANTON5",
"price_discount_type": "flat",
"flat_value": 5,
"percentage_value": null,
"apply_to_volume": false
},
"attached_by": {
"kind": "member",
"id": "9c41e7b2-3a5d-4f18-8e6c-2b7d0a9f4c13",
"label": "Pam Beesly"
}
},
"meta": {
"request_id": "e3b7d1f9-2a6c-4d85-b1e4-7f2a9c3d5e16",
"timestamp": "2026-09-30T15:30: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",
"code": "<string>",
"blocked_date": "2026-11-30",
"blocked_day": 30,
"allowed_date": "2026-11-28",
"payment_uuid": "<string>",
"error_details": [
{
"code": "<string>",
"field": "<string>",
"payment": "not_attempted",
"message": "<string>"
}
],
"coded_recovery": true
}
}{
"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",
"payment_uuid": "<string>",
"error_details": [
{
"code": "<string>",
"field": "<string>",
"payment": "not_attempted",
"message": "<string>"
}
],
"coded_recovery": true
}
}Authorizations
Bearer token authentication
Path Parameters
Subscription token
Body
application/json
⌘I
Attach subscription discount
curl --request POST \
--url https://api.fluid.app/api/checkout/v2026-04/subscriptions/{token}/discounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"discount_code": "SCRANTON5",
"duration": "once",
"notes": "Welcome back offer"
}
'import requests
url = "https://api.fluid.app/api/checkout/v2026-04/subscriptions/{token}/discounts"
payload = {
"discount_code": "SCRANTON5",
"duration": "once",
"notes": "Welcome back offer"
}
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({discount_code: 'SCRANTON5', duration: 'once', notes: 'Welcome back offer'})
};
fetch('https://api.fluid.app/api/checkout/v2026-04/subscriptions/{token}/discounts', 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/checkout/v2026-04/subscriptions/{token}/discounts",
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([
'discount_code' => 'SCRANTON5',
'duration' => 'once',
'notes' => 'Welcome back offer'
]),
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/checkout/v2026-04/subscriptions/{token}/discounts"
payload := strings.NewReader("{\n \"discount_code\": \"SCRANTON5\",\n \"duration\": \"once\",\n \"notes\": \"Welcome back offer\"\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/checkout/v2026-04/subscriptions/{token}/discounts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"discount_code\": \"SCRANTON5\",\n \"duration\": \"once\",\n \"notes\": \"Welcome back offer\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/checkout/v2026-04/subscriptions/{token}/discounts")
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 \"discount_code\": \"SCRANTON5\",\n \"duration\": \"once\",\n \"notes\": \"Welcome back offer\"\n}"
response = http.request(request)
puts response.read_body{
"subscription_discount": {
"id": 6254,
"company_id": 1405,
"subscription_id": 48213,
"discount_id": 1977,
"discount_version_id": 2461,
"attached_by_member_id": "9c41e7b2-3a5d-4f18-8e6c-2b7d0a9f4c13",
"attached_by_droplet_installation_id": null,
"duration": "once",
"duration_cycles": null,
"applied_cycles": 0,
"removed_reason": null,
"removed_detail": null,
"attached_via": "manual_member",
"notes": "Welcome back offer",
"starts_at": "2026-09-30T15:30:12Z",
"removed_at": null,
"created_at": "2026-09-30T15:30:12Z",
"updated_at": "2026-09-30T15:30:12Z",
"discount": {
"id": 1977,
"code": "SCRANTON5"
},
"discount_version": {
"id": 2461,
"version_number": 2,
"code": "SCRANTON5",
"price_discount_type": "flat",
"flat_value": 5,
"percentage_value": null,
"apply_to_volume": false
},
"attached_by": {
"kind": "member",
"id": "9c41e7b2-3a5d-4f18-8e6c-2b7d0a9f4c13",
"label": "Pam Beesly"
}
},
"meta": {
"request_id": "e3b7d1f9-2a6c-4d85-b1e4-7f2a9c3d5e16",
"timestamp": "2026-09-30T15:30: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",
"code": "<string>",
"blocked_date": "2026-11-30",
"blocked_day": 30,
"allowed_date": "2026-11-28",
"payment_uuid": "<string>",
"error_details": [
{
"code": "<string>",
"field": "<string>",
"payment": "not_attempted",
"message": "<string>"
}
],
"coded_recovery": true
}
}{
"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",
"payment_uuid": "<string>",
"error_details": [
{
"code": "<string>",
"field": "<string>",
"payment": "not_attempted",
"message": "<string>"
}
],
"coded_recovery": true
}
}