Apply the retention offer the customer took instead of cancelling
curl --request POST \
--url https://api.tagada.io/api/v1/portal/cancel-flow/accept \
--header 'Content-Type: application/json' \
--header 'x-cms-token: <api-key>' \
--data '
{
"target": {
"type": "subscription",
"subscriptionId": "<string>"
},
"reasonId": "<string>",
"offerId": "<string>",
"optionId": "<string>",
"productId": "<string>",
"variantId": "<string>",
"days": 183
}
'import requests
url = "https://api.tagada.io/api/v1/portal/cancel-flow/accept"
payload = {
"target": {
"type": "subscription",
"subscriptionId": "<string>"
},
"reasonId": "<string>",
"offerId": "<string>",
"optionId": "<string>",
"productId": "<string>",
"variantId": "<string>",
"days": 183
}
headers = {
"x-cms-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-cms-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
target: {type: 'subscription', subscriptionId: '<string>'},
reasonId: '<string>',
offerId: '<string>',
optionId: '<string>',
productId: '<string>',
variantId: '<string>',
days: 183
})
};
fetch('https://api.tagada.io/api/v1/portal/cancel-flow/accept', 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.tagada.io/api/v1/portal/cancel-flow/accept",
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([
'target' => [
'type' => 'subscription',
'subscriptionId' => '<string>'
],
'reasonId' => '<string>',
'offerId' => '<string>',
'optionId' => '<string>',
'productId' => '<string>',
'variantId' => '<string>',
'days' => 183
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-cms-token: <api-key>"
],
]);
$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.tagada.io/api/v1/portal/cancel-flow/accept"
payload := strings.NewReader("{\n \"target\": {\n \"type\": \"subscription\",\n \"subscriptionId\": \"<string>\"\n },\n \"reasonId\": \"<string>\",\n \"offerId\": \"<string>\",\n \"optionId\": \"<string>\",\n \"productId\": \"<string>\",\n \"variantId\": \"<string>\",\n \"days\": 183\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-cms-token", "<api-key>")
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.tagada.io/api/v1/portal/cancel-flow/accept")
.header("x-cms-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"target\": {\n \"type\": \"subscription\",\n \"subscriptionId\": \"<string>\"\n },\n \"reasonId\": \"<string>\",\n \"offerId\": \"<string>\",\n \"optionId\": \"<string>\",\n \"productId\": \"<string>\",\n \"variantId\": \"<string>\",\n \"days\": 183\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tagada.io/api/v1/portal/cancel-flow/accept")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-cms-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"target\": {\n \"type\": \"subscription\",\n \"subscriptionId\": \"<string>\"\n },\n \"reasonId\": \"<string>\",\n \"offerId\": \"<string>\",\n \"optionId\": \"<string>\",\n \"productId\": \"<string>\",\n \"variantId\": \"<string>\",\n \"days\": 183\n}"
response = http.request(request)
puts response.read_body{
"subscription": {
"id": "<string>",
"customerId": "<string>",
"status": "active",
"productId": "<string>",
"variantId": "<string>",
"optionId": "<string>",
"currency": "<string>",
"quantity": 2,
"price": 123,
"startedAt": "2023-12-25",
"nextBillingAt": "2023-12-25",
"trialEndsAt": "2023-12-25",
"pausedUntil": "2023-12-25",
"canceledAt": "2023-12-25",
"cancelReasonId": "<string>",
"skippedDates": [
"2023-12-25"
],
"lastPaymentFailedAt": "2023-12-25",
"paymentMethodId": "<string>",
"shippingAddressId": "<string>",
"paidOrdersCount": 1,
"nextOrderAddOns": [
{
"productId": "<string>",
"variantId": "<string>",
"quantity": 2,
"unitPrice": 123
}
]
},
"membership": {
"id": "<string>",
"customerId": "<string>",
"programId": "<string>",
"status": "active",
"billing": "monthly",
"startedAt": "2023-12-25",
"renewsAt": "2023-12-25",
"trialEndsAt": "2023-12-25",
"graceEndsAt": "2023-12-25",
"canceledAt": "2023-12-25",
"creditsBalance": 1,
"savedToDate": 123,
"paymentMethodId": "<string>"
}
}{
"message": "<string>",
"code": "<string>",
"issues": [
{
"message": "<string>"
}
]
}portal
Apply the retention offer the customer took instead of cancelling
Apply the retention offer the customer took instead of cancelling
POST
/
api
/
v1
/
portal
/
cancel-flow
/
accept
Apply the retention offer the customer took instead of cancelling
curl --request POST \
--url https://api.tagada.io/api/v1/portal/cancel-flow/accept \
--header 'Content-Type: application/json' \
--header 'x-cms-token: <api-key>' \
--data '
{
"target": {
"type": "subscription",
"subscriptionId": "<string>"
},
"reasonId": "<string>",
"offerId": "<string>",
"optionId": "<string>",
"productId": "<string>",
"variantId": "<string>",
"days": 183
}
'import requests
url = "https://api.tagada.io/api/v1/portal/cancel-flow/accept"
payload = {
"target": {
"type": "subscription",
"subscriptionId": "<string>"
},
"reasonId": "<string>",
"offerId": "<string>",
"optionId": "<string>",
"productId": "<string>",
"variantId": "<string>",
"days": 183
}
headers = {
"x-cms-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-cms-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
target: {type: 'subscription', subscriptionId: '<string>'},
reasonId: '<string>',
offerId: '<string>',
optionId: '<string>',
productId: '<string>',
variantId: '<string>',
days: 183
})
};
fetch('https://api.tagada.io/api/v1/portal/cancel-flow/accept', 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.tagada.io/api/v1/portal/cancel-flow/accept",
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([
'target' => [
'type' => 'subscription',
'subscriptionId' => '<string>'
],
'reasonId' => '<string>',
'offerId' => '<string>',
'optionId' => '<string>',
'productId' => '<string>',
'variantId' => '<string>',
'days' => 183
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-cms-token: <api-key>"
],
]);
$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.tagada.io/api/v1/portal/cancel-flow/accept"
payload := strings.NewReader("{\n \"target\": {\n \"type\": \"subscription\",\n \"subscriptionId\": \"<string>\"\n },\n \"reasonId\": \"<string>\",\n \"offerId\": \"<string>\",\n \"optionId\": \"<string>\",\n \"productId\": \"<string>\",\n \"variantId\": \"<string>\",\n \"days\": 183\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-cms-token", "<api-key>")
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.tagada.io/api/v1/portal/cancel-flow/accept")
.header("x-cms-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"target\": {\n \"type\": \"subscription\",\n \"subscriptionId\": \"<string>\"\n },\n \"reasonId\": \"<string>\",\n \"offerId\": \"<string>\",\n \"optionId\": \"<string>\",\n \"productId\": \"<string>\",\n \"variantId\": \"<string>\",\n \"days\": 183\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tagada.io/api/v1/portal/cancel-flow/accept")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-cms-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"target\": {\n \"type\": \"subscription\",\n \"subscriptionId\": \"<string>\"\n },\n \"reasonId\": \"<string>\",\n \"offerId\": \"<string>\",\n \"optionId\": \"<string>\",\n \"productId\": \"<string>\",\n \"variantId\": \"<string>\",\n \"days\": 183\n}"
response = http.request(request)
puts response.read_body{
"subscription": {
"id": "<string>",
"customerId": "<string>",
"status": "active",
"productId": "<string>",
"variantId": "<string>",
"optionId": "<string>",
"currency": "<string>",
"quantity": 2,
"price": 123,
"startedAt": "2023-12-25",
"nextBillingAt": "2023-12-25",
"trialEndsAt": "2023-12-25",
"pausedUntil": "2023-12-25",
"canceledAt": "2023-12-25",
"cancelReasonId": "<string>",
"skippedDates": [
"2023-12-25"
],
"lastPaymentFailedAt": "2023-12-25",
"paymentMethodId": "<string>",
"shippingAddressId": "<string>",
"paidOrdersCount": 1,
"nextOrderAddOns": [
{
"productId": "<string>",
"variantId": "<string>",
"quantity": 2,
"unitPrice": 123
}
]
},
"membership": {
"id": "<string>",
"customerId": "<string>",
"programId": "<string>",
"status": "active",
"billing": "monthly",
"startedAt": "2023-12-25",
"renewsAt": "2023-12-25",
"trialEndsAt": "2023-12-25",
"graceEndsAt": "2023-12-25",
"canceledAt": "2023-12-25",
"creditsBalance": 1,
"savedToDate": 123,
"paymentMethodId": "<string>"
}
}{
"message": "<string>",
"code": "<string>",
"issues": [
{
"message": "<string>"
}
]
}Authorizations
CMS session JWT from /api/v1/cms/session/login. Customer account operations require an email-verified session; signed offer links accept an anonymous store session.
Body
application/json
- Option 1
- Option 2
Show child attributes
Show child attributes
Minimum string length:
1Minimum string length:
1Minimum string length:
1Minimum string length:
1Minimum string length:
1Required range:
1 <= x <= 365