LogoLogo
Document ValidationsPayment Methods
Latest
Latest
  • D24 APIs
  • Getting Started with D24
  • API Documentation
    • Deposits API
      • Technical and Security Aspects
        • Calculating the Signature
      • Endpoints
        • Deposit Creation Endpoint
          • Notifications
        • PCI Deposit Creation Endpoint
        • Deposit Status Endpoint
        • Payment Methods Endpoint
        • Currency Exchange Endpoint
        • Crypto Exchange Endpoint
        • Country States Codes Endpoint
        • Refund Creation Endpoint
          • Notifications
        • Refund Status Endpoint
      • Payment Methods
        • ๐ŸŒŽAmerica
          • ๐Ÿ‡ฆ๐Ÿ‡ทArgentina
          • ๐Ÿ‡ง๐Ÿ‡ดBolivia
          • ๐Ÿ‡ง๐Ÿ‡ทBrazil
          • ๐Ÿ‡จ๐Ÿ‡ฑChile
          • ๐Ÿ‡จ๐Ÿ‡ฆCanada
          • ๐Ÿ‡จ๐Ÿ‡ดColombia
          • ๐Ÿ‡ช๐Ÿ‡จEcuador
          • ๐Ÿ‡ฌ๐Ÿ‡นGuatemala
          • ๐Ÿ‡ฒ๐Ÿ‡ฝMexico
          • ๐Ÿ‡ต๐Ÿ‡พParaguay
          • ๐Ÿ‡ต๐Ÿ‡ชPeru
        • ๐ŸŒAfrica
          • ๐Ÿ‡ง๐Ÿ‡ผBotswana
          • ๐Ÿ‡จ๐Ÿ‡ฒCameroon
          • ๐Ÿ‡จ๐Ÿ‡ฌCongo Brazzaville
          • ๐Ÿ‡จ๐Ÿ‡ฉCongo DRC
          • ๐Ÿ‡ช๐Ÿ‡ฌEgypt
          • ๐Ÿ‡ฌ๐Ÿ‡ฆGabon
          • ๐Ÿ‡ฌ๐Ÿ‡ญGhana
          • ๐Ÿ‡จ๐Ÿ‡ฎIvory Coast
          • ๐Ÿ‡ฐ๐Ÿ‡ชKenya
          • ๐Ÿ‡ณ๐Ÿ‡ฌNigeria
          • ๐Ÿ‡ฒ๐Ÿ‡ผMalawi
          • ๐Ÿ‡ท๐Ÿ‡ผRwanda
          • ๐Ÿ‡ฟ๐Ÿ‡ฆSouth Africa
          • ๐Ÿ‡บ๐Ÿ‡ฌUganda
          • ๐Ÿ‡ฟ๐Ÿ‡ฒZambia
          • ๐Ÿ‡น๐Ÿ‡ฟTanzania
        • ๐ŸŒAsia
          • ๐Ÿ‡ง๐Ÿ‡ฉBangladesh
          • ๐Ÿ‡จ๐Ÿ‡ณChina
          • ๐Ÿ‡ญ๐Ÿ‡ฐHong Kong
          • ๐Ÿ‡ฎ๐Ÿ‡ณIndia
          • ๐Ÿ‡ฎ๐Ÿ‡ฉIndonesia
          • ๐Ÿ‡ฏ๐Ÿ‡ตJapan
          • ๐Ÿ‡ฒ๐Ÿ‡พMalaysia
          • ๐Ÿ‡ต๐Ÿ‡ฐPakistan
          • ๐Ÿ‡น๐Ÿ‡ญThailand
          • ๐Ÿ‡น๐Ÿ‡ทTurkey
          • ๐Ÿ‡ป๐Ÿ‡ณVietnam
      • API Codes
    • Cashouts API
      • Technical and Security Aspects
        • Calculating the Payload-Signature
      • Endpoints
        • Cashout Creation Endpoint
          • Notifications
        • Cashout Status Endpoint
        • Cashout Update Status Endpoint
        • Cashout Cancellation Endpoint
        • Cashout Bank Codes
      • Countries Validations
        • American Countries
          • ๐Ÿ‡ง๐Ÿ‡ดBolivia
          • ๐Ÿ‡ง๐Ÿ‡ทBrazil
          • ๐Ÿ‡จ๐Ÿ‡ฆCanada
          • ๐Ÿ‡จ๐Ÿ‡ฑChile
          • ๐Ÿ‡จ๐Ÿ‡ดColombia
          • ๐Ÿ‡ช๐Ÿ‡จEcuador
          • ๐Ÿ‡ฒ๐Ÿ‡ฝMexico
          • ๐Ÿ‡ต๐Ÿ‡ชPeru
          • ๐Ÿ‡ฆ๐Ÿ‡ทArgentina
          • ๐Ÿ‡ต๐Ÿ‡พParaguay
        • African Countries
          • ๐Ÿ‡ง๐Ÿ‡ผBotwsana
          • ๐Ÿ‡จ๐Ÿ‡ฒCameroon
          • ๐Ÿ‡จ๐Ÿ‡ฌCongo Brazzaville
          • ๐Ÿ‡จ๐Ÿ‡ฉCongo DRC
          • ๐Ÿ‡ช๐Ÿ‡ฌEgypt
          • ๐Ÿ‡ฌ๐Ÿ‡ฆGabon
          • ๐Ÿ‡ฌ๐Ÿ‡ญGhana
          • ๐Ÿ‡ฐ๐Ÿ‡ชKenya
          • ๐Ÿ‡ฒ๐Ÿ‡ผMalawi
          • ๐Ÿ‡ณ๐Ÿ‡ฌNigeria
          • ๐Ÿ‡ท๐Ÿ‡ผRwanda
          • ๐Ÿ‡ฟ๐Ÿ‡ฆSOUTH AFRICA
          • ๐Ÿ‡ฟ๐Ÿ‡ฒZambia
        • Asian Countries
          • ๐Ÿ‡ง๐Ÿ‡ฉBangladesh
          • ๐Ÿ‡จ๐Ÿ‡ณChina
          • ๐Ÿ‡ฎ๐Ÿ‡ณIndia
          • ๐Ÿ‡ฎ๐Ÿ‡ฉIndonesia
          • ๐Ÿ‡ฏ๐Ÿ‡ตJapan
          • ๐Ÿ‡ฒ๐Ÿ‡พMalaysia
          • ๐Ÿ‡น๐Ÿ‡ญThailand
          • ๐Ÿ‡น๐Ÿ‡ทTurkey
          • ๐Ÿ‡ต๐Ÿ‡ฐPakistan
          • ๐Ÿ‡ป๐Ÿ‡ณVietnam
        • Oceania Countries
          • ๐Ÿ‡ฆ๐Ÿ‡บAustralia
      • API Codes
    • Subscriptions API
      • Technical and Security Aspects
        • Calculating the Signature
      • Subscription Creation Endpoints
        • OneShot Subscription Creation
        • PCI Subscription Creation Endpoint
        • Notifications
      • Subscription Cancellation Endpoint
      • Subscription Status Endpoint
    • Bank Accounts Validation API
      • Technical and Security Aspects
        • Calculating the Signature
      • Endpoints
        • Bank Account Validation Endpoint
        • Pix Key Validation Endpoint
      • API Codes
    • KYC API
      • Technical and Security Aspects
        • Calculating the Signature
      • KYC Endpoint
      • API Codes
    • Reconciliation API
      • Technical and Security Aspects
      • Endpoints
      • API Codes
    • Quickpay
      • Endpoints
        • Deposit creation endpoint
          • Notifications
        • Deposit Status Endpoint
    • Tools for Platforms
      • Technical and Security Aspects
        • Calculating the Signature
      • SubMerchant Creation
        • Notifications
      • SubMerchant Status Endpoint
      • Commission Update Endpoint
  • PLUGINS
    • Shopify
      • Installation
      • Onboarding
      • Customer flow
      • Admin Flow
      • Tutorials
      • FAQ
    • WooCommerce
      • Installation
      • Configuration
  • Deposits Tools
    • Cards SDK
      • With User Interface
        • ๐Ÿš€Color Customization
      • Without User Interface
    • Java SDK
    • PHP SDK
  • Knowledge Base
    • Countries Specifications
    • Deposits with Cards SDK
      • With User Interface
      • Without User Interface
    • Deposits with 3DS Authentication
    • Deposits with Installments
  • v1 Developers Guide
  • Status Page
Powered by GitBook
On this page

Was this helpful?

  1. API Documentation
  2. Subscriptions API

Subscription Cancellation Endpoint

PreviousNotificationsNextSubscription Status Endpoint

Last updated 1 month ago

Was this helpful?

Overview

The Subscription Cancellation API allows merchants to terminate an active subscription before its scheduled end date. Once cancelled, no further charges will be processed for that subscription.

Endpoint

DELETE https://api-stg.directa24.com/v3/subscriptions/{subscription_id}

Where {subscription_id} is the unique numeric identifier of the subscription you wish to cancel.

Request Parameters

This endpoint uses only a path parameter to identify the subscription:

Parameter
Type
Required
Description

id

integer

Yes

Unique numeric identifier of the subscription to cancel.

Request Body

The request body should be empty for this endpoint.

{}

Response

Success Response

Error Responses

The API may return the following errors:

Subscription Already Cancelled (421)

Returned when attempting to cancel a subscription that has already been cancelled:

{
  "code": 421,
  "description": "Subscription was already cancelled.",
  "type": "SUBSCRIPTION_ALREADY_CANCELLED"
}

Subscription Not Found (420)

Returned when the specified subscription ID does not exist:

{
  "code": 420,
  "description": "Subscription does not exist.",
  "type": "SUBSCRIPTION_NOT_FOUND"
}

Subscription Terminated (426)

Returned when attempting to cancel a subscription that has already been terminated (completed its lifecycle):

{
  "code": 426,
  "description": "Subscription is terminated and cannot be cancelled.",
  "type": "SUBSCRIPTION_IS_TERMINATED"
}

Generic Error (501)

Returned when an unexpected error occurs:

{
  "code": 501,
  "description": "Generic Error",
  "type": "GENERIC_ERROR"
}

Cancellation Effects

When a subscription is cancelled:

  1. The subscription status is immediately changed to CANCELLED

  2. All scheduled future charges are removed

  3. The cancellation is recorded in the subscription history

Important Notes

  1. Cancellation vs. Refund: Cancelling a subscription only prevents future charges. It does not refund any previous charges. To process refunds for previous transactions, use the separate Refund API.

  2. Reactivation: Once a subscription is cancelled, it cannot be reactivated. A new subscription must be created if the customer wishes to resume the service.

  3. Timing: Cancellation takes effect immediately, regardless of the subscription's billing cycle.

A successful cancellation returns an HTTP 200 status code .

โœ…
  • Overview
  • Endpoint
  • DELETECancel a subscription
  • Request Parameters
  • Request Body
  • Response
  • Error Responses
  • Cancellation Effects
  • Important Notes

Cancel a subscription

delete

This endpoint allows cancellation of an existing subscription by ID.

Path parameters
subscription_idinteger ยท int64Required

Unique numeric identifier of the subscription to be cancelled. This is the subscription ID provided when the subscription was created.

Example: 123456789
Header parameters
Content-TypestringRequired

Media type of the body sent to the API.

Default: application/json
X-Datestring ยท date-timeRequired

ISO8601 Datetime with Timezone (yyyy-MM-dd'T'HH:mm:ssZ)

X-LoginstringRequired

Merchant X-Login API Key.

AuthorizationstringRequired

Authorization control hash.

X-Idempotency-KeystringOptional

Unique idempotency key for ensuring that the same request is not processed more than once.

Body
objectOptional
Responses
200
Subscription successfully cancelled
application/json
Responseobject
420
Subscription does not exist
application/json
421
Subscription was already cancelled
application/json
426
Subscription is terminated and cannot be cancelled
application/json
501
Generic Error
application/json
delete
DELETE /v3/subscriptions/{subscription_id} HTTP/1.1
Host: api-stg.directa24.com
Content-Type: application/json
X-Date: 2025-05-11T15:29:57.788Z
X-Login: text
Authorization: text
Accept: */*
Content-Length: 2

{}
{}