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.
DELETE https://services.leadconnectorhq.com/payments/coupon
Autorización
Bearer token generado desde el portal Leadway. Ver Autenticación .
Version
string
default: "2021-07-28"
required
Versión de la API.
Body
altId
string
default: "BQdAwxa0ky1iK2sstLGJ"
required
Account Id
altType
string
default: "account"
required
Alt Type Posibles valores: ‘account’
id
string
default: "6241712be68f7a98102ba272"
required
Coupon Id
Respuestas
200 - Successful response
success
boolean
default: "True"
required
Indicates whether the delete was successful
traceId
string
default: "c667b18d-8f5e-44cf-a914"
required
Unique identifier for tracing this API request
{
"success" : true ,
"traceId" : "c667b18d-8f5e-44cf-a914"
}
422 - Unprocessable Entity
Ejemplo
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 );