Confirm Cancel
Phase 2: finalize the cancellation. Pass the same orderIdentifier from the request phase. Optionally include a survey payload for analytics.
URL
POST /api/c2a/subscription/cancel/confirm
Request Parameters
Body: ConfirmCancelRequest.
| Name | Type | Description |
|---|---|---|
orderIdentifier | string | Required. Same id as in cancel/request. |
cancelationMethod | string (EnSubscriptionCancelMethod) | Required. Mirror the method from the request phase. |
currentStep | integer | Funnel step. |
survey | string | Free-form payload (e.g. JSON) capturing reason code + comment. |
source | string (EnInteractionSource) | Forced to C2A server-side. |
Request Example
{
"orderIdentifier": "or_01J3X...",
"cancelationMethod": "Normal",
"currentStep": 1,
"survey": "{\"reasonCode\":\"PRICE\",\"comment\":\"Too expensive\"}"
}
Response Parameters
ConfirmCancelResponse envelope. Actual state transition happens through the resolved subscription provider:
- In-house — Azotte writes the cancellation directly, with
endDatehonoringcancelationMethod. - App Store / Play Store — Azotte updates its mirror only — store-side cancellation must be initiated by the user on their device. Mirror reflects the store webhook when it arrives.
- PayPal / Third-party — Azotte calls the provider's cancel API and waits for the provider's confirmation event.
| Name | Type | Description |
|---|---|---|
status | object (AzotteStatus) | Operation status envelope. |
Sample Response
{ "status": { "messageCode": "SUCCESS" } }
Sample Codes
- cURL
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
curl --location 'https://acme.sandbox.azotte.com/api/v1/c2a/subscription/cancel/confirm' \
--header 'Content-Type: application/json' \
--header 'x-tn: e2a1c7b2-4f3a-4b8e-9c2d-1a2b3c4d5e6f' \
--header 'x-api-key: sk_dev_acme_sample_123456789' \
--data '{
"orderIdentifier": "or_01J3X...",
"cancelationMethod": "Normal",
"currentStep": 1,
"survey": "{\"reasonCode\":\"PRICE\",\"comment\":\"Too expensive\"}"
}'
const res = await fetch('https://acme.sandbox.azotte.com/api/v1/c2a/subscription/cancel/confirm', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-tn': 'e2a1c7b2-4f3a-4b8e-9c2d-1a2b3c4d5e6f',
'x-api-key': 'sk_dev_acme_sample_123456789'
},
body: JSON.stringify({
orderIdentifier: 'or_01J3X...',
cancelationMethod: 'Normal',
currentStep: 1,
survey: JSON.stringify({ reasonCode: 'PRICE', comment: 'Too expensive' })
})
});
console.log(await res.json());
import { request } from 'undici';
const { body } = await request(
'https://acme.sandbox.azotte.com/api/v1/c2a/subscription/cancel/confirm',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-tn': 'e2a1c7b2-4f3a-4b8e-9c2d-1a2b3c4d5e6f',
'x-api-key': 'sk_dev_acme_sample_123456789'
},
body: JSON.stringify({
orderIdentifier: 'or_01J3X...',
cancelationMethod: 'Normal',
currentStep: 1,
survey: JSON.stringify({ reasonCode: 'PRICE', comment: 'Too expensive' })
})
}
);
console.log(await body.json());
import json
import requests
survey = json.dumps({"reasonCode": "PRICE", "comment": "Too expensive"})
res = requests.post(
"https://acme.sandbox.azotte.com/api/v1/c2a/subscription/cancel/confirm",
headers={
"Content-Type": "application/json",
"x-tn": "e2a1c7b2-4f3a-4b8e-9c2d-1a2b3c4d5e6f",
"x-api-key": "sk_dev_acme_sample_123456789",
},
json={
"orderIdentifier": "or_01J3X...",
"cancelationMethod": "Normal",
"currentStep": 1,
"survey": survey,
},
)
print(res.json())
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
String json = """
{
"orderIdentifier": "or_01J3X...",
"cancelationMethod": "Normal",
"currentStep": 1,
"survey": "{\\"reasonCode\\":\\"PRICE\\",\\"comment\\":\\"Too expensive\\"}"
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://acme.sandbox.azotte.com/api/v1/c2a/subscription/cancel/confirm"))
.header("Content-Type", "application/json")
.header("x-tn", "e2a1c7b2-4f3a-4b8e-9c2d-1a2b3c4d5e6f")
.header("x-api-key", "sk_dev_acme_sample_123456789")
.POST(HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println(res.body());
using System.Net.Http.Json;
using System.Text.Json;
var survey = JsonSerializer.Serialize(new { reasonCode = "PRICE", comment = "Too expensive" });
var payload = new {
orderIdentifier = "or_01J3X...",
cancelationMethod = "Normal",
currentStep = 1,
survey
};
using var http = new HttpClient();
http.DefaultRequestHeaders.Add("x-tn", "e2a1c7b2-4f3a-4b8e-9c2d-1a2b3c4d5e6f");
http.DefaultRequestHeaders.Add("x-api-key", "sk_dev_acme_sample_123456789");
var res = await http.PostAsJsonAsync(
"https://acme.sandbox.azotte.com/api/v1/c2a/subscription/cancel/confirm",
payload);
Console.WriteLine(await res.Content.ReadAsStringAsync());
<?php
$survey = json_encode(['reasonCode' => 'PRICE', 'comment' => 'Too expensive']);
$payload = [
'orderIdentifier' => 'or_01J3X...',
'cancelationMethod' => 'Normal',
'currentStep' => 1,
'survey' => $survey,
];
$ch = curl_init('https://acme.sandbox.azotte.com/api/v1/c2a/subscription/cancel/confirm');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'x-tn: e2a1c7b2-4f3a-4b8e-9c2d-1a2b3c4d5e6f',
'x-api-key: sk_dev_acme_sample_123456789',
],
CURLOPT_POSTFIELDS => json_encode($payload),
]);
echo curl_exec($ch);
curl_close($ch);
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
surveyBytes, _ := json.Marshal(map[string]string{
"reasonCode": "PRICE",
"comment": "Too expensive",
})
payload := map[string]any{
"orderIdentifier": "or_01J3X...",
"cancelationMethod": "Normal",
"currentStep": 1,
"survey": string(surveyBytes),
}
body, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST",
"https://acme.sandbox.azotte.com/api/v1/c2a/subscription/cancel/confirm",
bytes.NewReader(body))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("x-tn", "e2a1c7b2-4f3a-4b8e-9c2d-1a2b3c4d5e6f")
req.Header.Set("x-api-key", "sk_dev_acme_sample_123456789")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(string(out))
}