---
title: "Delete Coupon"
source_url: https://docs.rapyd.net/en/delete-coupon.html
lang: en
---

# Delete Coupon

Delete a coupon from the Rapyd platform.

Deleting a coupon removes it from all customers and subscriptions, but does not affect invoices and payment authorizations that have already been calculated.

This method triggers the **Coupon Deleted** webhook. This webhook contains the same information as the response.

### Parameters

### Request Path Parameters

- - coupon
  - ID of the coupon.

### Request Header Parameters

- - access_key
  - Unique access key provided by Rapyd for each authorized user.

    See [Developers](https://docs.rapyd.net/en/developers.md "Developers").
- - Content-Type
  - Indicates that the data appears in JSON format. Set to **application/json**.
- - salt
  - Random string. Recommended length: 8-16 characters.
- - signature
  - Signature calculated for each request individually.

    See [Request Signatures](https://docs.rapyd.net/en/request-signatures.md "Request Signatures").
- - timestamp
  - Timestamp for the request, in [Unix time](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_unix_time "Unix time") (seconds).

### Response Parameters

- - id
  - ID of the coupon.
- - deleted
  - Indicates whether the coupon has been deleted.

### Code Samples

- - .NET

    - ```csharp
      using System;

      namespace RapydApiRequestSample
      {
          class Program
          {
              static void Main(string[] args)
              {
                  try
                  {
                      string coupon = "coupon_629d690ba9aa73791ec3817f143278b3";

                      string result = RapydApiRequestSample.Utilities.MakeRequest("DELETE", $"/v1/coupons/{coupon}");

                      Console.WriteLine(result);
                  }
                  catch (Exception e)
                  {
                      Console.WriteLine("Error completing request: " + e.Message);
                  }
              }
          }
      }
      ```
- - JavaScript

    - ```javascript
      const makeRequest = require('<path-to-your-utility-file>/utilities').makeRequest;

      async function main() {
        try {
          const result = await makeRequest(
            'DELETE',
            '/v1/coupons/coupon_629d690ba9aa73791ec3817f143278b3'
          );

          console.log(result);
        } catch (error) {
          console.error('Error completing request', error);
        }
      }
      ```
- - PHP

    - ```php
      <?php
      $path = $_SERVER['DOCUMENT_ROOT'];
      $path .= "/<path-to-your-utility-file>/utilities.php";
      include($path);

      try {
          $object = make_request('delete', '/v1/coupons/coupon_629d690ba9aa73791ec3817f143278b3');
          var_dump($object);
      } catch(Exception $e) {
          echo "Error =>$e";
      }
      ?>
      ```
- - Python

    - ```python
      from pprint import pprint

      from utilities import make_request

      coupon_id = "coupon_629d690ba9aa73791ec3817f143278b3"
      result = make_request(method='delete', path=f'/v1/coupons/{coupon_id}')
      pprint(result)
      ```

- /v1/coupons/:coupon

- Delete Coupon
- ```curl
  curl -X delete 'https://sandboxapi.rapyd.net/v1/coupons/coupon_629d690ba9aa73791ec3817f143278b3' \
  -H 'access_key: your-access-key-here' \
  -H 'Content-Type: application/json' \
  -H 'salt: your-random-string-here' \
  -H 'signature: your-calculated-signature-here' \
  -H 'timestamp: your-unix-timestamp-here'
  ```
- ```json
  {
      "status": {
          "error_code": "",
          "status": "SUCCESS",
          "message": "",
          "response_code": "",
          "operation_id": "64397d77-5f91-4779-b1a5-c3cbc461ff07"
      },
      "data": {
          "id": "coupon_fd4f25dc9cebb97311f8a5b02fec2afc",
          "deleted": true
      }
  }
  ```
