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
DELETE https://services.leadconnectorhq.com/payments/couponAuthorization
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
Authorization | string | Yes | Bearer token generated from the Leadway portal. See Authentication. | |
Version | string | Yes | 2021-07-28 | API version. |
Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
altId | string | Yes | BQdAwxa0ky1iK2sstLGJ | Account Id |
altType | string | Yes | account | Alt Type Possible values: 'account' |
id | string | Yes | 6241712be68f7a98102ba272 | Coupon Id |
Responses
200 - Successful response
success(boolean, required): Indicates whether the delete was successful Example:TruetraceId(string, required): Unique identifier for tracing this API request Example:c667b18d-8f5e-44cf-a914
json
{
"success": true,
"traceId": "c667b18d-8f5e-44cf-a914"
}422 - Unprocessable Entity
json
{}Example
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"
}'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();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
$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);