settings-v0
Publish the next version of the company's cancel flow
Publishes the whole flow as the next version. Published versions never change, so each cancellation session can name the version it ran. The request names the version it read (0 for the default flow); a publish on top of a newer version is refused with 409 (stale_retention_flow). reasons must list each customer reason code exactly once and show at least one. Each reason shows at most two offers of distinct types, and each offer's terms must suit its type: delay {days 7-60}, change_frequency {subscription_plan_id}, swap {variant_ids, 1-50}, pause {months 1-3}, discount {percentage 1-100, duration once, or repeating with duration_cycles 2-12}, contact_support {url, https}, skip_next {}. free_gift is refused with offer_type_unavailable until milestone items exist. An offer naming a plan or variant the company does not have is refused with unknown_offer_reference. Answers 404 while the company cannot use the cancel flow, as GET does.
POST
/
api
/
subscription_pro
/
retention_flow
Publish the next version of the company's cancel flow
curl --request POST \
--url https://api.fluid.app/api/subscription_pro/retention_flow \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_version": 0,
"reasons": [
{
"code": "too_expensive",
"hidden": false,
"labels": {
"en": "Too expensive",
"es": "Demasiado caro"
}
},
{
"code": "too_much_product",
"hidden": false,
"labels": {}
},
{
"code": "too_frequent",
"hidden": false,
"labels": {}
},
{
"code": "not_seeing_results",
"hidden": false,
"labels": {}
},
{
"code": "did_not_like_product",
"hidden": false,
"labels": {}
},
{
"code": "switching_brand",
"hidden": true,
"labels": {}
},
{
"code": "shipping_or_delivery_issue",
"hidden": false,
"labels": {}
},
{
"code": "taking_a_break",
"hidden": false,
"labels": {}
},
{
"code": "moving_or_life_change",
"hidden": false,
"labels": {}
},
{
"code": "other",
"hidden": false,
"labels": {}
}
],
"offers_by_reason": {
"too_expensive": [
{
"type": "discount",
"terms": {
"percentage": 20,
"duration": "repeating",
"duration_cycles": 3
}
},
{
"type": "skip_next",
"terms": {}
}
]
}
}
'import requests
url = "https://api.fluid.app/api/subscription_pro/retention_flow"
payload = {
"expected_version": 0,
"reasons": [
{
"code": "too_expensive",
"hidden": False,
"labels": {
"en": "Too expensive",
"es": "Demasiado caro"
}
},
{
"code": "too_much_product",
"hidden": False,
"labels": {}
},
{
"code": "too_frequent",
"hidden": False,
"labels": {}
},
{
"code": "not_seeing_results",
"hidden": False,
"labels": {}
},
{
"code": "did_not_like_product",
"hidden": False,
"labels": {}
},
{
"code": "switching_brand",
"hidden": True,
"labels": {}
},
{
"code": "shipping_or_delivery_issue",
"hidden": False,
"labels": {}
},
{
"code": "taking_a_break",
"hidden": False,
"labels": {}
},
{
"code": "moving_or_life_change",
"hidden": False,
"labels": {}
},
{
"code": "other",
"hidden": False,
"labels": {}
}
],
"offers_by_reason": { "too_expensive": [
{
"type": "discount",
"terms": {
"percentage": 20,
"duration": "repeating",
"duration_cycles": 3
}
},
{
"type": "skip_next",
"terms": {}
}
] }
}
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({
expected_version: 0,
reasons: [
{
code: 'too_expensive',
hidden: false,
labels: {en: 'Too expensive', es: 'Demasiado caro'}
},
{code: 'too_much_product', hidden: false, labels: {}},
{code: 'too_frequent', hidden: false, labels: {}},
{code: 'not_seeing_results', hidden: false, labels: {}},
{code: 'did_not_like_product', hidden: false, labels: {}},
{code: 'switching_brand', hidden: true, labels: {}},
{code: 'shipping_or_delivery_issue', hidden: false, labels: {}},
{code: 'taking_a_break', hidden: false, labels: {}},
{code: 'moving_or_life_change', hidden: false, labels: {}},
{code: 'other', hidden: false, labels: {}}
],
offers_by_reason: {
too_expensive: [
{
type: 'discount',
terms: {percentage: 20, duration: 'repeating', duration_cycles: 3}
},
{type: 'skip_next', terms: {}}
]
}
})
};
fetch('https://api.fluid.app/api/subscription_pro/retention_flow', 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/subscription_pro/retention_flow",
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([
'expected_version' => 0,
'reasons' => [
[
'code' => 'too_expensive',
'hidden' => false,
'labels' => [
'en' => 'Too expensive',
'es' => 'Demasiado caro'
]
],
[
'code' => 'too_much_product',
'hidden' => false,
'labels' => [
]
],
[
'code' => 'too_frequent',
'hidden' => false,
'labels' => [
]
],
[
'code' => 'not_seeing_results',
'hidden' => false,
'labels' => [
]
],
[
'code' => 'did_not_like_product',
'hidden' => false,
'labels' => [
]
],
[
'code' => 'switching_brand',
'hidden' => true,
'labels' => [
]
],
[
'code' => 'shipping_or_delivery_issue',
'hidden' => false,
'labels' => [
]
],
[
'code' => 'taking_a_break',
'hidden' => false,
'labels' => [
]
],
[
'code' => 'moving_or_life_change',
'hidden' => false,
'labels' => [
]
],
[
'code' => 'other',
'hidden' => false,
'labels' => [
]
]
],
'offers_by_reason' => [
'too_expensive' => [
[
'type' => 'discount',
'terms' => [
'percentage' => 20,
'duration' => 'repeating',
'duration_cycles' => 3
]
],
[
'type' => 'skip_next',
'terms' => [
]
]
]
]
]),
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/subscription_pro/retention_flow"
payload := strings.NewReader("{\n \"expected_version\": 0,\n \"reasons\": [\n {\n \"code\": \"too_expensive\",\n \"hidden\": false,\n \"labels\": {\n \"en\": \"Too expensive\",\n \"es\": \"Demasiado caro\"\n }\n },\n {\n \"code\": \"too_much_product\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"too_frequent\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"not_seeing_results\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"did_not_like_product\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"switching_brand\",\n \"hidden\": true,\n \"labels\": {}\n },\n {\n \"code\": \"shipping_or_delivery_issue\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"taking_a_break\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"moving_or_life_change\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"other\",\n \"hidden\": false,\n \"labels\": {}\n }\n ],\n \"offers_by_reason\": {\n \"too_expensive\": [\n {\n \"type\": \"discount\",\n \"terms\": {\n \"percentage\": 20,\n \"duration\": \"repeating\",\n \"duration_cycles\": 3\n }\n },\n {\n \"type\": \"skip_next\",\n \"terms\": {}\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/subscription_pro/retention_flow")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expected_version\": 0,\n \"reasons\": [\n {\n \"code\": \"too_expensive\",\n \"hidden\": false,\n \"labels\": {\n \"en\": \"Too expensive\",\n \"es\": \"Demasiado caro\"\n }\n },\n {\n \"code\": \"too_much_product\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"too_frequent\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"not_seeing_results\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"did_not_like_product\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"switching_brand\",\n \"hidden\": true,\n \"labels\": {}\n },\n {\n \"code\": \"shipping_or_delivery_issue\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"taking_a_break\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"moving_or_life_change\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"other\",\n \"hidden\": false,\n \"labels\": {}\n }\n ],\n \"offers_by_reason\": {\n \"too_expensive\": [\n {\n \"type\": \"discount\",\n \"terms\": {\n \"percentage\": 20,\n \"duration\": \"repeating\",\n \"duration_cycles\": 3\n }\n },\n {\n \"type\": \"skip_next\",\n \"terms\": {}\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/subscription_pro/retention_flow")
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 \"expected_version\": 0,\n \"reasons\": [\n {\n \"code\": \"too_expensive\",\n \"hidden\": false,\n \"labels\": {\n \"en\": \"Too expensive\",\n \"es\": \"Demasiado caro\"\n }\n },\n {\n \"code\": \"too_much_product\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"too_frequent\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"not_seeing_results\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"did_not_like_product\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"switching_brand\",\n \"hidden\": true,\n \"labels\": {}\n },\n {\n \"code\": \"shipping_or_delivery_issue\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"taking_a_break\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"moving_or_life_change\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"other\",\n \"hidden\": false,\n \"labels\": {}\n }\n ],\n \"offers_by_reason\": {\n \"too_expensive\": [\n {\n \"type\": \"discount\",\n \"terms\": {\n \"percentage\": 20,\n \"duration\": \"repeating\",\n \"duration_cycles\": 3\n }\n },\n {\n \"type\": \"skip_next\",\n \"terms\": {}\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"retention_flow": {
"reasons": [
{
"code": "too_expensive",
"hidden": true,
"labels": {}
}
],
"offers_by_reason": {},
"version": 1,
"default": true
},
"offer_types": [
{
"type": "skip_next",
"monetary": true,
"saves": true,
"available": true
}
],
"status": 200,
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}Authorizations
Bearer token authentication
Body
application/json
Every customer reason code once, in the order customers see them.
Show child attributes
Show child attributes
Customer reason code to the save offers it shows, at most two of distinct types.
Show child attributes
Show child attributes
The version the flow was read at
Required range:
x >= 0⌘I
Publish the next version of the company's cancel flow
curl --request POST \
--url https://api.fluid.app/api/subscription_pro/retention_flow \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_version": 0,
"reasons": [
{
"code": "too_expensive",
"hidden": false,
"labels": {
"en": "Too expensive",
"es": "Demasiado caro"
}
},
{
"code": "too_much_product",
"hidden": false,
"labels": {}
},
{
"code": "too_frequent",
"hidden": false,
"labels": {}
},
{
"code": "not_seeing_results",
"hidden": false,
"labels": {}
},
{
"code": "did_not_like_product",
"hidden": false,
"labels": {}
},
{
"code": "switching_brand",
"hidden": true,
"labels": {}
},
{
"code": "shipping_or_delivery_issue",
"hidden": false,
"labels": {}
},
{
"code": "taking_a_break",
"hidden": false,
"labels": {}
},
{
"code": "moving_or_life_change",
"hidden": false,
"labels": {}
},
{
"code": "other",
"hidden": false,
"labels": {}
}
],
"offers_by_reason": {
"too_expensive": [
{
"type": "discount",
"terms": {
"percentage": 20,
"duration": "repeating",
"duration_cycles": 3
}
},
{
"type": "skip_next",
"terms": {}
}
]
}
}
'import requests
url = "https://api.fluid.app/api/subscription_pro/retention_flow"
payload = {
"expected_version": 0,
"reasons": [
{
"code": "too_expensive",
"hidden": False,
"labels": {
"en": "Too expensive",
"es": "Demasiado caro"
}
},
{
"code": "too_much_product",
"hidden": False,
"labels": {}
},
{
"code": "too_frequent",
"hidden": False,
"labels": {}
},
{
"code": "not_seeing_results",
"hidden": False,
"labels": {}
},
{
"code": "did_not_like_product",
"hidden": False,
"labels": {}
},
{
"code": "switching_brand",
"hidden": True,
"labels": {}
},
{
"code": "shipping_or_delivery_issue",
"hidden": False,
"labels": {}
},
{
"code": "taking_a_break",
"hidden": False,
"labels": {}
},
{
"code": "moving_or_life_change",
"hidden": False,
"labels": {}
},
{
"code": "other",
"hidden": False,
"labels": {}
}
],
"offers_by_reason": { "too_expensive": [
{
"type": "discount",
"terms": {
"percentage": 20,
"duration": "repeating",
"duration_cycles": 3
}
},
{
"type": "skip_next",
"terms": {}
}
] }
}
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({
expected_version: 0,
reasons: [
{
code: 'too_expensive',
hidden: false,
labels: {en: 'Too expensive', es: 'Demasiado caro'}
},
{code: 'too_much_product', hidden: false, labels: {}},
{code: 'too_frequent', hidden: false, labels: {}},
{code: 'not_seeing_results', hidden: false, labels: {}},
{code: 'did_not_like_product', hidden: false, labels: {}},
{code: 'switching_brand', hidden: true, labels: {}},
{code: 'shipping_or_delivery_issue', hidden: false, labels: {}},
{code: 'taking_a_break', hidden: false, labels: {}},
{code: 'moving_or_life_change', hidden: false, labels: {}},
{code: 'other', hidden: false, labels: {}}
],
offers_by_reason: {
too_expensive: [
{
type: 'discount',
terms: {percentage: 20, duration: 'repeating', duration_cycles: 3}
},
{type: 'skip_next', terms: {}}
]
}
})
};
fetch('https://api.fluid.app/api/subscription_pro/retention_flow', 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/subscription_pro/retention_flow",
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([
'expected_version' => 0,
'reasons' => [
[
'code' => 'too_expensive',
'hidden' => false,
'labels' => [
'en' => 'Too expensive',
'es' => 'Demasiado caro'
]
],
[
'code' => 'too_much_product',
'hidden' => false,
'labels' => [
]
],
[
'code' => 'too_frequent',
'hidden' => false,
'labels' => [
]
],
[
'code' => 'not_seeing_results',
'hidden' => false,
'labels' => [
]
],
[
'code' => 'did_not_like_product',
'hidden' => false,
'labels' => [
]
],
[
'code' => 'switching_brand',
'hidden' => true,
'labels' => [
]
],
[
'code' => 'shipping_or_delivery_issue',
'hidden' => false,
'labels' => [
]
],
[
'code' => 'taking_a_break',
'hidden' => false,
'labels' => [
]
],
[
'code' => 'moving_or_life_change',
'hidden' => false,
'labels' => [
]
],
[
'code' => 'other',
'hidden' => false,
'labels' => [
]
]
],
'offers_by_reason' => [
'too_expensive' => [
[
'type' => 'discount',
'terms' => [
'percentage' => 20,
'duration' => 'repeating',
'duration_cycles' => 3
]
],
[
'type' => 'skip_next',
'terms' => [
]
]
]
]
]),
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/subscription_pro/retention_flow"
payload := strings.NewReader("{\n \"expected_version\": 0,\n \"reasons\": [\n {\n \"code\": \"too_expensive\",\n \"hidden\": false,\n \"labels\": {\n \"en\": \"Too expensive\",\n \"es\": \"Demasiado caro\"\n }\n },\n {\n \"code\": \"too_much_product\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"too_frequent\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"not_seeing_results\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"did_not_like_product\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"switching_brand\",\n \"hidden\": true,\n \"labels\": {}\n },\n {\n \"code\": \"shipping_or_delivery_issue\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"taking_a_break\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"moving_or_life_change\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"other\",\n \"hidden\": false,\n \"labels\": {}\n }\n ],\n \"offers_by_reason\": {\n \"too_expensive\": [\n {\n \"type\": \"discount\",\n \"terms\": {\n \"percentage\": 20,\n \"duration\": \"repeating\",\n \"duration_cycles\": 3\n }\n },\n {\n \"type\": \"skip_next\",\n \"terms\": {}\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/subscription_pro/retention_flow")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expected_version\": 0,\n \"reasons\": [\n {\n \"code\": \"too_expensive\",\n \"hidden\": false,\n \"labels\": {\n \"en\": \"Too expensive\",\n \"es\": \"Demasiado caro\"\n }\n },\n {\n \"code\": \"too_much_product\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"too_frequent\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"not_seeing_results\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"did_not_like_product\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"switching_brand\",\n \"hidden\": true,\n \"labels\": {}\n },\n {\n \"code\": \"shipping_or_delivery_issue\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"taking_a_break\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"moving_or_life_change\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"other\",\n \"hidden\": false,\n \"labels\": {}\n }\n ],\n \"offers_by_reason\": {\n \"too_expensive\": [\n {\n \"type\": \"discount\",\n \"terms\": {\n \"percentage\": 20,\n \"duration\": \"repeating\",\n \"duration_cycles\": 3\n }\n },\n {\n \"type\": \"skip_next\",\n \"terms\": {}\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/subscription_pro/retention_flow")
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 \"expected_version\": 0,\n \"reasons\": [\n {\n \"code\": \"too_expensive\",\n \"hidden\": false,\n \"labels\": {\n \"en\": \"Too expensive\",\n \"es\": \"Demasiado caro\"\n }\n },\n {\n \"code\": \"too_much_product\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"too_frequent\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"not_seeing_results\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"did_not_like_product\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"switching_brand\",\n \"hidden\": true,\n \"labels\": {}\n },\n {\n \"code\": \"shipping_or_delivery_issue\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"taking_a_break\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"moving_or_life_change\",\n \"hidden\": false,\n \"labels\": {}\n },\n {\n \"code\": \"other\",\n \"hidden\": false,\n \"labels\": {}\n }\n ],\n \"offers_by_reason\": {\n \"too_expensive\": [\n {\n \"type\": \"discount\",\n \"terms\": {\n \"percentage\": 20,\n \"duration\": \"repeating\",\n \"duration_cycles\": 3\n }\n },\n {\n \"type\": \"skip_next\",\n \"terms\": {}\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"retention_flow": {
"reasons": [
{
"code": "too_expensive",
"hidden": true,
"labels": {}
}
],
"offers_by_reason": {},
"version": 1,
"default": true
},
"offer_types": [
{
"type": "skip_next",
"monetary": true,
"saves": true,
"available": true
}
],
"status": 200,
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}