# Start/Stop a Subscription

> For the complete documentation index, see [llms.txt](https://docs.fondy.io/llms.txt).

This endpoint allows merchants to start or stop a subscription for an order.

**POST** `/subscription/`

Base URL: `https://pay.fondy.eu/api`

This endpoint allows merchants to start or stop a subscription for an order.

## Body

Content type: `application/json`

- `request` (object)
  - `merchant_id` (integer, required)
    A unique identifier assigned to the merchant by Fondy upon account registration. This ID is required for authenticating requests and associating transactions with the merchant's account.
  - `order_id` (string, required)
    A unique identifier for the order. This can be any value defined by the merchant, allowing you to use any internal order identification system your business employs.
  - `action` ("start" | "stop", required)
    Specifies the action to perform on the subscription. Use `start` to resume a subscription, enabling scheduled payments, or `stop` to cancel the subscription, preventing future payments.
  - `signature` (string, required)
    Signature for request verification, generated according to Fondy’s algorithm. Required to verify merchant request consistency and authenticity.
    Learn how to use Fondy’s algorithm at the [Signature Generation for Request and Response](doc:signatures) page.

Example:

```json
{
  "request": {
    "merchant_id": 1,
    "order_id": "ORDER_12345678",
    "action": "stop",
    "signature": "1773cf135bd89656131134b98637894dad42f808"
  }
}
```

## Responses

### 200

Successful Response

- `response` (object)
  - `response_status` ("success" | "failure")
    Indicates whether the request was processed successfully or failed validation. Returns `success` if the action was completed successfully, otherwise `failure`.
  - `status` (string)
    Provides a descriptive message about the outcome of the action, such as confirming the subscription was stopped or started successfully.
  - `error_message` (string)
    Detailed description of the error, explaining why the request failed. This field is only populated when `response_status` is `failure`.
  - `error_code` (integer)
    Numeric code representing the specific error that occurred. This field is only populated when `response_status` is `failure`.

Example:

```json
{
  "response": {
    "response_status": "success",
    "status": "Subscription stopped successfully",
    "error_message": "Invalid signature",
    "error_code": 2032
  }
}
```