---
api: 'Merchant API'
---

# Cancel a subscription

Cancel a subscription.

You can cancel a subscription in any state except `cancelled` or `finished`. When you cancel a subscription, it will be marked as `cancelled` and no further billing cycles will be created. Any pending orders will be cancelled.

## Endpoint

POST `/api/subscriptions/{subscription_id}/cancel`

## Returns

### 204

Subscription cancelled successfully

## Error responses

| HTTP status code | Description |
| --- | --- |
| 400 | Bad Request |
| 401 | Unauthorized |
| 404 | Subscription not found |
