> ## Documentation Index
> Fetch the complete documentation index at: https://fastflowpe.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Manage Subscription

> Use this POST endpoint to pause, activate, or cancel an existing recurring subscription.

Use the internal `subscription_id` returned by the subscription initialize API.

Do not use `merchant_ref_id` or the PSP subscription ID for subscription management operations.

Use the API key in the `x-api-key` header. Do not send it in the `Authorization` header.

> [!TIP]
>
> **Quick Reference**
>
> **Required:** `subscription_id`, `action`
>
> **Supported Actions:** `PAUSE`, `ACTIVATE`, `CANCEL`
>
> **Method:** `POST`

## Endpoint

```http theme={"dark"}
POST https://api.fastflowpe.com/merchant/recurring/subscription/manage
```

## Request Headers

**x-api-key** `string` *required*

Your secret merchant API key issued by FastFlowPe.

**Content-Type** `string` *required*

Must be `application/json`.

**Accept** `string` *required*

Must be `application/json`.

## Request Body

**subscription\_id** `string` *required*

Internal FastFlowPe subscription UUID returned by the subscription initialize API.

Do not pass `merchant_ref_id` or the PSP subscription ID.

**action** `string` *required*

Management action to perform on the subscription.

Supported values:

* `PAUSE`
* `ACTIVATE`
* `CANCEL`

## Management Rules

| Action | Required Current Status | Result |
| - | - | - |
| `PAUSE` | `SUCCESS` | Local subscription status becomes `HOLD`. |
| `ACTIVATE` | `HOLD` | Local subscription status becomes `SUCCESS`. |
| `CANCEL` | Any non-cancelled status | Local subscription status becomes `CANCELED`. |

> [!NOTE]
>
> Always use the internal FastFlowPe `subscription_id` returned by the initialize API for management operations.

## Pause Subscription

Use the `PAUSE` action to pause an active subscription.

The subscription must currently have status `SUCCESS`.

```bash cURL theme={"dark"}
curl --location 'https://api.fastflowpe.com/merchant/recurring/subscription/manage' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <your-x-api-key>' \
--data '{
    "subscription_id": "YOUR_SUBSCRIPTION_UUID",
    "action": "PAUSE"
}'
```

```python Python theme={"dark"}
import requests

url = "https://api.fastflowpe.com/merchant/recurring/subscription/manage"
headers = {"Accept": "application/json", "Content-Type": "application/json", "x-api-key": "<your-x-api-key>"}
payload = {
    "subscription_id": "YOUR_SUBSCRIPTION_UUID",
    "action": "PAUSE"
}

response = requests.post(url, json=payload, headers=headers)
print(response.json())
```

```javascript Node.js theme={"dark"}
const response = await fetch("https://api.fastflowpe.com/merchant/recurring/subscription/manage", {
  method: "POST",
  headers: {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "x-api-key": "<your-x-api-key>",
  },
  body: JSON.stringify({
    subscription_id: "YOUR_SUBSCRIPTION_UUID",
    action: "PAUSE",
  }),
});
console.log(await response.json());
```

```java Java theme={"dark"}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

String body = """
{
  "subscription_id": "YOUR_SUBSCRIPTION_UUID",
  "action": "PAUSE"
}
""";

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.fastflowpe.com/merchant/recurring/subscription/manage"))
    .header("Accept", "application/json")
    .header("Content-Type", "application/json")
    .header("x-api-key", "<your-x-api-key>")
    .POST(HttpRequest.BodyPublishers.ofString(body))
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

```go Go theme={"dark"}
package main

import (
    "bytes"
    "fmt"
    "io"
    "net/http"
)

func main() {
    payload := []byte(`{
        "subscription_id": "YOUR_SUBSCRIPTION_UUID",
        "action": "PAUSE"
    }`)

    req, _ := http.NewRequest("POST", "https://api.fastflowpe.com/merchant/recurring/subscription/manage", bytes.NewBuffer(payload))
    req.Header.Set("Accept", "application/json")
    req.Header.Set("Content-Type", "application/json")
    req.Header.Set("x-api-key", "<your-x-api-key>")

    resp, _ := http.DefaultClient.Do(req)
    defer resp.Body.Close()
    body, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body))
}
```

```php PHP theme={"dark"}
<?php
$payload = json_encode([
    "subscription_id" => "YOUR_SUBSCRIPTION_UUID",
    "action" => "PAUSE",
]);

$ch = curl_init("https://api.fastflowpe.com/merchant/recurring/subscription/manage");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Accept: application/json",
    "Content-Type: application/json",
    "x-api-key: <your-x-api-key>",
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

```ruby Ruby theme={"dark"}
require 'net/http'
require 'uri'
require 'json'

uri = URI('https://api.fastflowpe.com/merchant/recurring/subscription/manage')
request = Net::HTTP::Post.new(uri)
request['Accept'] = 'application/json'
request['Content-Type'] = 'application/json'
request['x-api-key'] = '<your-x-api-key>'
request.body = {
  subscription_id: 'YOUR_SUBSCRIPTION_UUID',
  action: 'PAUSE',
}.to_json

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }
puts response.body
```

### Response

```json Success theme={"dark"}
{
  "status": "success",
  "status_code": 200,
  "message": "Subscription paused successfully",
  "detail": null,
  "data": {
    "subscription_id": "4cbbd450-b326-4cac-9913-f772c57824b8",
    "previous_status": "SUCCESS",
    "current_status": "PAUSED"
  },
  "meta": null
}
```

```json Invalid State theme={"dark"}
{
  "status": "success",
  "status_code": 200,
  "message": "Cannot pause — subscription is currently CREATED",
  "detail": null,
  "data": {
    "subscription_id": "4cbbd450-b326-4cac-9913-f772c57824b8",
    "current_status": "CREATED"
  },
  "meta": null
}
```

> [!NOTE]
>
> The external PSP may return `PAUSED`, while FastFlowPe stores the local subscription status as `HOLD`.

***

## Activate Subscription

Use the `ACTIVATE` action to reactivate a paused subscription.

The subscription must currently have status `HOLD`.

```bash cURL theme={"dark"}
curl --location 'https://api.fastflowpe.com/merchant/recurring/subscription/manage' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <your-x-api-key>' \
--data '{
    "subscription_id": "YOUR_SUBSCRIPTION_UUID",
    "action": "ACTIVATE"
}'
```

```python Python theme={"dark"}
import requests

url = "https://api.fastflowpe.com/merchant/recurring/subscription/manage"
headers = {"Accept": "application/json", "Content-Type": "application/json", "x-api-key": "<your-x-api-key>"}
payload = {
    "subscription_id": "YOUR_SUBSCRIPTION_UUID",
    "action": "ACTIVATE"
}

response = requests.post(url, json=payload, headers=headers)
print(response.json())
```

```javascript Node.js theme={"dark"}
const response = await fetch("https://api.fastflowpe.com/merchant/recurring/subscription/manage", {
  method: "POST",
  headers: {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "x-api-key": "<your-x-api-key>",
  },
  body: JSON.stringify({
    subscription_id: "YOUR_SUBSCRIPTION_UUID",
    action: "ACTIVATE",
  }),
});
console.log(await response.json());
```

```java Java theme={"dark"}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

String body = """
{
  "subscription_id": "YOUR_SUBSCRIPTION_UUID",
  "action": "ACTIVATE"
}
""";

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.fastflowpe.com/merchant/recurring/subscription/manage"))
    .header("Accept", "application/json")
    .header("Content-Type", "application/json")
    .header("x-api-key", "<your-x-api-key>")
    .POST(HttpRequest.BodyPublishers.ofString(body))
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

```go Go theme={"dark"}
package main

import (
    "bytes"
    "fmt"
    "io"
    "net/http"
)

func main() {
    payload := []byte(`{
        "subscription_id": "YOUR_SUBSCRIPTION_UUID",
        "action": "ACTIVATE"
    }`)

    req, _ := http.NewRequest("POST", "https://api.fastflowpe.com/merchant/recurring/subscription/manage", bytes.NewBuffer(payload))
    req.Header.Set("Accept", "application/json")
    req.Header.Set("Content-Type", "application/json")
    req.Header.Set("x-api-key", "<your-x-api-key>")

    resp, _ := http.DefaultClient.Do(req)
    defer resp.Body.Close()
    body, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body))
}
```

```php PHP theme={"dark"}
<?php
$payload = json_encode([
    "subscription_id" => "YOUR_SUBSCRIPTION_UUID",
    "action" => "ACTIVATE",
]);

$ch = curl_init("https://api.fastflowpe.com/merchant/recurring/subscription/manage");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Accept: application/json",
    "Content-Type: application/json",
    "x-api-key: <your-x-api-key>",
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

```ruby Ruby theme={"dark"}
require 'net/http'
require 'uri'
require 'json'

uri = URI('https://api.fastflowpe.com/merchant/recurring/subscription/manage')
request = Net::HTTP::Post.new(uri)
request['Accept'] = 'application/json'
request['Content-Type'] = 'application/json'
request['x-api-key'] = '<your-x-api-key>'
request.body = {
  subscription_id: 'YOUR_SUBSCRIPTION_UUID',
  action: 'ACTIVATE',
}.to_json

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }
puts response.body
```

### Response

```json Success theme={"dark"}
{
  "status": "success",
  "status_code": 200,
  "message": "Subscription activated successfully",
  "detail": null,
  "data": {
    "subscription_id": "4cbbd450-b326-4cac-9913-f772c57824b8",
    "previous_status": "HOLD",
    "current_status": "ACTIVE"
  },
  "meta": null
}
```

```json Invalid State theme={"dark"}
{
  "status": "success",
  "status_code": 200,
  "message": "Cannot activate — subscription is currently SUCCESS",
  "detail": null,
  "data": {
    "subscription_id": "4cbbd450-b326-4cac-9913-f772c57824b8",
    "current_status": "SUCCESS"
  },
  "meta": null
}
```

> [!NOTE]
>
> The external PSP may return `ACTIVE`, while FastFlowPe stores the local subscription status as `SUCCESS`.
>
> After activation, the next scheduled charge time is set to the next day at midnight IST.

***

## Cancel Subscription

Use the `CANCEL` action to cancel an existing subscription.

A subscription can be cancelled from any valid non-cancelled state.

```bash cURL theme={"dark"}
curl --location 'https://api.fastflowpe.com/merchant/recurring/subscription/manage' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <your-x-api-key>' \
--data '{
    "subscription_id": "YOUR_SUBSCRIPTION_UUID",
    "action": "CANCEL"
}'
```

```python Python theme={"dark"}
import requests

url = "https://api.fastflowpe.com/merchant/recurring/subscription/manage"
headers = {"Accept": "application/json", "Content-Type": "application/json", "x-api-key": "<your-x-api-key>"}
payload = {
    "subscription_id": "YOUR_SUBSCRIPTION_UUID",
    "action": "CANCEL"
}

response = requests.post(url, json=payload, headers=headers)
print(response.json())
```

```javascript Node.js theme={"dark"}
const response = await fetch("https://api.fastflowpe.com/merchant/recurring/subscription/manage", {
  method: "POST",
  headers: {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "x-api-key": "<your-x-api-key>",
  },
  body: JSON.stringify({
    subscription_id: "YOUR_SUBSCRIPTION_UUID",
    action: "CANCEL",
  }),
});
console.log(await response.json());
```

```java Java theme={"dark"}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

String body = """
{
  "subscription_id": "YOUR_SUBSCRIPTION_UUID",
  "action": "CANCEL"
}
""";

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.fastflowpe.com/merchant/recurring/subscription/manage"))
    .header("Accept", "application/json")
    .header("Content-Type", "application/json")
    .header("x-api-key", "<your-x-api-key>")
    .POST(HttpRequest.BodyPublishers.ofString(body))
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

```go Go theme={"dark"}
package main

import (
    "bytes"
    "fmt"
    "io"
    "net/http"
)

func main() {
    payload := []byte(`{
        "subscription_id": "YOUR_SUBSCRIPTION_UUID",
        "action": "CANCEL"
    }`)

    req, _ := http.NewRequest("POST", "https://api.fastflowpe.com/merchant/recurring/subscription/manage", bytes.NewBuffer(payload))
    req.Header.Set("Accept", "application/json")
    req.Header.Set("Content-Type", "application/json")
    req.Header.Set("x-api-key", "<your-x-api-key>")

    resp, _ := http.DefaultClient.Do(req)
    defer resp.Body.Close()
    body, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body))
}
```

```php PHP theme={"dark"}
<?php
$payload = json_encode([
    "subscription_id" => "YOUR_SUBSCRIPTION_UUID",
    "action" => "CANCEL",
]);

$ch = curl_init("https://api.fastflowpe.com/merchant/recurring/subscription/manage");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Accept: application/json",
    "Content-Type: application/json",
    "x-api-key: <your-x-api-key>",
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

```ruby Ruby theme={"dark"}
require 'net/http'
require 'uri'
require 'json'

uri = URI('https://api.fastflowpe.com/merchant/recurring/subscription/manage')
request = Net::HTTP::Post.new(uri)
request['Accept'] = 'application/json'
request['Content-Type'] = 'application/json'
request['x-api-key'] = '<your-x-api-key>'
request.body = {
  subscription_id: 'YOUR_SUBSCRIPTION_UUID',
  action: 'CANCEL',
}.to_json

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }
puts response.body
```

### Response

```json Success theme={"dark"}
{
  "status": "success",
  "status_code": 200,
  "message": "Subscription canceld successfully",
  "detail": null,
  "data": {
    "subscription_id": "4cbbd450-b326-4cac-9913-f772c57824b8",
    "previous_status": "SUCCESS",
    "current_status": "CANCELLED"
  },
  "meta": null
}
```

> [!NOTE]
>
> The current backend response message is `Subscription canceld successfully`.
>
> This is only a message typo and does not affect the cancellation operation.

**status** `string`

Indicates whether the management request was processed successfully.

**status\_code** `integer`

HTTP-style status code associated with the response.

**message** `string`

Human-readable message describing the result of the requested management action.

**detail** `object`

Additional response details when available.

This may be `null`.

**data.subscription\_id** `string`

Internal FastFlowPe subscription UUID.

**data.previous\_status** `string`

Subscription status before the management action was applied.

This field is returned when the action successfully changes the subscription state.

**data.current\_status** `string`

Current subscription status after the action or the existing status when the requested action cannot be performed.

**meta** `object`

Optional response metadata.

This may be `null`.

## Status Mapping

FastFlowPe normalizes PSP subscription statuses internally.

| PSP Status | FastFlowPe Status |
| - | - |
| `PAUSED` | `HOLD` |
| `ACTIVE` | `SUCCESS` |
| `CANCELLED` | `CANCELED` |

> [!NOTE]
>
> A response such as `Cannot pause — subscription is currently CREATED` or `Cannot activate — subscription is currently SUCCESS` means the requested action is not valid for the subscription's current state.
>
> No state transition is performed in that case.

> [!TIP]
>
> Check the subscription status before performing a management action when your application needs to determine which actions are currently allowed.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.