Reactivate
Reactivate a subscription that was canceled but is still within its reactivation window (typically before endDate). Used to undo a previous cancellation, not to start a new subscription.
URL
POST /api/c2a/subscription/reactivate
Request Parameters
Body: RestartSubscriptionContext.
| Name | Type | Description |
|---|---|---|
orderIdentifier | string | Required. The canceled subscription's order id. |
source | string (EnInteractionSource) | Forced to C2A server-side. |
Request Example
{ "orderIdentifier": "or_01J3X..." }
Response Parameters
ReactivateSubscriptionResponse envelope.
| Name | Type | Description |
|---|---|---|
status | object (AzotteStatus) | Operation status envelope. |
Sample Response
{ "status": { "messageCode": "SUCCESS" } }
Behaviour
- Reactivation is only possible while the subscription is still on its current period (
endDatenot yet passed). After expiry, the customer must purchase a new subscription via Checkout. - For store-channel subscriptions, reactivation generally requires user action inside the store; the C2A call is a no-op or returns a provider-specific status.
Sample Codes
- cURL
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
curl --location 'https://acme.sandbox.azotte.com/api/v1/c2a/subscription/reactivate' \
--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..." }'
const res = await fetch('https://acme.sandbox.azotte.com/api/v1/c2a/subscription/reactivate', {
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...' })
});
console.log(await res.json());
import { request } from 'undici';
const { body } = await request(
'https://acme.sandbox.azotte.com/api/v1/c2a/subscription/reactivate',
{
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...' })
}
);
console.log(await body.json());
import requests
res = requests.post(
"https://acme.sandbox.azotte.com/api/v1/c2a/subscription/reactivate",
headers={
"Content-Type": "application/json",
"x-tn": "e2a1c7b2-4f3a-4b8e-9c2d-1a2b3c4d5e6f",
"x-api-key": "sk_dev_acme_sample_123456789",
},
json={"orderIdentifier": "or_01J3X..."},
)
print(res.json())
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://acme.sandbox.azotte.com/api/v1/c2a/subscription/reactivate"))
.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("{\"orderIdentifier\":\"or_01J3X...\"}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println(res.body());
using System.Net.Http.Json;
var payload = new { orderIdentifier = "or_01J3X..." };
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/reactivate",
payload);
Console.WriteLine(await res.Content.ReadAsStringAsync());
<?php
$ch = curl_init('https://acme.sandbox.azotte.com/api/v1/c2a/subscription/reactivate');
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(['orderIdentifier' => 'or_01J3X...']),
]);
echo curl_exec($ch);
curl_close($ch);
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
body := bytes.NewBufferString(`{"orderIdentifier":"or_01J3X..."}`)
req, _ := http.NewRequest("POST",
"https://acme.sandbox.azotte.com/api/v1/c2a/subscription/reactivate", 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))
}