> ## Documentation Index
> Fetch the complete documentation index at: https://developers.leadwaycrm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Coupon

> The "Delete Coupon" API allows you to permanently remove a coupon from your system using its unique identifier. Use this endpoint to discontinue promotional offers or clean up unused coupons. Note tha

The "Delete Coupon" API allows you to permanently remove a coupon from your system using its unique identifier. Use this endpoint to discontinue promotional offers or clean up unused coupons. Note that this action cannot be undone.

```http theme={null}
DELETE https://services.leadconnectorhq.com/payments/coupon
```

## Autorización

<ParamField header="Authorization" type="string" required>
  Bearer token generado desde el portal Leadway. Ver [Autenticación](/authentication).
</ParamField>

<ParamField header="Version" type="string" required default="2021-07-28">
  Versión de la API.
</ParamField>

## Body

<ParamField body="altId" type="string" required default="BQdAwxa0ky1iK2sstLGJ">
  Account Id
</ParamField>

<ParamField body="altType" type="string" required default="account">
  Alt Type Posibles valores: 'account'
</ParamField>

<ParamField body="id" type="string" required default="6241712be68f7a98102ba272">
  Coupon Id
</ParamField>

## Respuestas

<Accordion title="200 - Successful response">
  <ResponseField name="success" type="boolean" required default="True">
    Indicates whether the delete was successful
  </ResponseField>

  <ResponseField name="traceId" type="string" required default="c667b18d-8f5e-44cf-a914">
    Unique identifier for tracing this API request
  </ResponseField>

  ```json theme={null}
  {
    "success": true,
    "traceId": "c667b18d-8f5e-44cf-a914"
  }
  ```
</Accordion>

<Accordion title="422 - Unprocessable Entity">
  ```json theme={null}
  {}
  ```
</Accordion>

## Ejemplo

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE 'https://services.leadconnectorhq.com/payments/coupon' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Version: 2021-07-28' \
    -H 'Content-Type: application/json' \
    -d '{
    "altId": "BQdAwxa0ky1iK2sstLGJ",
    "altType": "account",
    "id": "6241712be68f7a98102ba272"
  }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://services.leadconnectorhq.com/payments/coupon', {
    method: 'DELETE',
    headers: {
      Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
      Version: '2021-07-28',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({"altId": "BQdAwxa0ky1iK2sstLGJ", "altType": "account", "id": "6241712be68f7a98102ba272"}),
  });
  const data = await response.json();
  ```

  ```python Python theme={null}
  import os, requests
  response = requests.request(
      'DELETE',
      'https://services.leadconnectorhq.com/payments/coupon',
      headers={
          'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
          'Version': '2021-07-28',
          'Content-Type': 'application/json',
      },
      json={"altId": "BQdAwxa0ky1iK2sstLGJ", "altType": "account", "id": "6241712be68f7a98102ba272"},
  )
  data = response.json()
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://services.leadconnectorhq.com/payments/coupon');
  curl_setopt_array($ch, [
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_CUSTOMREQUEST => 'DELETE',
      CURLOPT_HTTPHEADER => [
          'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
          'Version: 2021-07-28',
          'Content-Type: application/json',
      ],
      CURLOPT_POSTFIELDS => json_encode({'altId': 'BQdAwxa0ky1iK2sstLGJ', 'altType': 'account', 'id': '6241712be68f7a98102ba272'}),
  ]);
  $data = json_decode(curl_exec($ch), true);
  ```
</CodeGroup>
