---
title: "Cancel a subscription"
method: PUT
path: "/billing/subscriptions/{subscriptionId}/cancel"
---

# Cancel a subscription

`PUT /billing/subscriptions/{subscriptionId}/cancel`

## Request

- Base URL: `https://api-sandbox.ezypay.com/v2`
- URL: `https://api-sandbox.ezypay.com/v2/billing/subscriptions/{subscriptionId}/cancel`
- Auth: OAuth 2
  - Client credentials
  - Token URL: `https://identity-sandbox.ezypay.com/token`

Integrator can cancel a subscription using this API endpoint. The subscription Id will be required to cancel a subscription. 

Cancellation stops subsequent billing and payment collections but outstanding payments will remain and need to be resolved separately.

Integrators can choose to cancel a subscription in a future date (Do ensure the cancellation date is one day before your actual date the subscriptions needs to end) but the default will be today.

## Path parameters

- `subscriptionId` string, required

## Headers

- `merchant` string, required

## Request body

- object
  - `cancellationDate` string: Date when subscription should be cancelled. Supported format is YYYY-MM-DD

## Response `200`

200

- object
  - `id` string
  - `customerId` string
  - `planId` string
  - `name` string
  - `status` string
  - `startDate` string
  - `endDate` unknown
  - `paymentMethodToken` string
  - `accountingCode` string
  - `amount` object
    - `currency` string
    - `value` integer
    - `type` unknown
  - `tax` object
    - `rate` integer
  - `nextBillingDate` unknown
  - `nextFutureInvoice` unknown
  - `interval` integer
  - `intervalUnit` string
  - `totalPaid` object
    - `currency` string
    - `value` integer
    - `type` unknown
  - `totalBillingCycles` integer
  - `remainingToPay` unknown
  - `remainingBillingCycles` unknown
  - `endTargetAmount` unknown
  - `endTargetBillingCycles` unknown
  - `cancelledDate` string
  - `failedPaymentHandling` unknown
  - `failedAttemptsCount` integer
  - `totalPastDue` object
    - `currency` string
    - `value` integer
    - `type` unknown
  - `totalDiscounted` object
    - `currency` string
    - `value` integer
    - `type` unknown
  - `metadata` unknown
  - `createdOn` string
  - `autoPayment` boolean
  - `setupPayments` unknown

## Other responses

- `400`: 400

## Changes

- **2026-11-03** `924be4030f56`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/ezypay/apis/vault/changes/billing/subscriptions/:subscriptionId/cancel/put.md)

---

[API](https://skmtc.dev/ezypay/apis/vault.md) - [All operations](https://skmtc.dev/ezypay/apis/vault/llms.txt) - [OpenAPI document](https://skmtc.dev/ezypay/apis/vault/revisions/924be4030f56?raw)
