---
updatedAt: 2025-06-25T21:25:18.000Z
agentTools:
  projectIndex: https://docs.geidea.net/llms.txt
---

# Cancel Subscription

To cancel a subscription means to terminate the recurring payments or recurring payment link and associated services for a specific customer's subscription. The merchant can initiate this action for various reasons such as customer request, non-payment, or termination of services.

To initiate a Cancel Subscription API call, you will need to provide the required "subscriptionid" field as part of the path parameters:

| Parameter        | Datatype | Description                                                                                                                                                                                                     | Mandatory        |
| ---------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------- |
| `subscriptionid` | string   | The id generated on the subscription creation                                                                                                                                                                   | Yes (path parms) |
| `signature`      | string   | A parameter to ensure the security and authenticity of API communications. It involves generating a signature using the contents of the API request and secret keys, which is then sent along with the request. | Yes              |

> 📘 Usage of the API environment endpoints
>
> Please make sure you use the correct endpoint based on your environment
>
> * KSA Environment: <https://api.ksamerchant.geidea.net/>
> * Egypt Environment: <https://api.merchant.geidea.net/>
> * UAE Environment: <https://api.geidea.ae/>

<br />

### Signature creation for Cancel Subscription

We have a signature parameter in the Cancel Subscription API to have an additional layer of security during payment processing. To generate the signature, follow the steps below:

1. Concatenate the parameters MerchantPublicKey and SubscriptionID as a string
2. Hash the concatenated string with the MerchantPrivateKey(API password) as a key (algorithm for hashing: SHA256)
3. Convert Hashed Value to Base64Str

### Signature creation for Cancel Subscription response

1. Concatenate the parameters MerchantPublicKey, Amount, Response Code, and Detail Response Code as a string
2. Hash the concatenated string with the MerchantPrivateKey(API password) as a key (algorithm for hashing: SHA256)
3. Convert Hashed Value to Base64Str

### Sample Request & Response

```asp Example Request
curl --request POST \
     --url https://api.merchant.geidea.net/subscriptions/api/v1/direct/subscription/8a055aa4-13d9-4f74-421d-08dc3cbb381c/cancel \
     --header 'accept: application/json' \
     --header 'authorization: Basic YTA4N2Y0Y2EtOTg5MC00MDdiLTljMmYtNzYzMDgzNmNjMDIwOjI2ZDMxOTE3LTcxNWUtNDhhYy1iMDcyLWRhOTczODAxNmFmNQ=='
       --data-raw '{
  
  		 "signature":"1KeVT7QumxpsWY8SnWN8WzTBlKdwz1EGBaANIEoh5mg="
}'
```