Create Coupon
The “Create Coupon” API allows you to create a new promotional coupon with customizable parameters such as discount amount, validity period, usage limits, and applicable products. Use this endpoint to set up promotional offers and special discounts for your customers.
POST
/
payments
/
coupon
Create Coupon
curl --request POST \
--url https://services.leadconnectorhq.com/payments/coupon \
--header 'Content-Type: application/json' \
--header 'Version: <version>' \
--data '
{
"altId": "BQdAwxa0ky1iK2sstLGJ",
"altType": "location",
"name": "New Year Sale",
"code": "LEVELUPDAY2022",
"discountType": "amount",
"discountValue": 10,
"startDate": "2023-01-01T22:45:00.000Z",
"endDate": "2023-01-31T22:45:00.000Z",
"usageLimit": 10,
"productIds": [
"6241712be68f7a98102ba272"
],
"applyToFuturePayments": true,
"applyToFuturePaymentsConfig": [
{
"type": "fixed",
"duration": 5,
"durationType": "months"
},
{
"type": "forever"
}
],
"limitPerCustomer": true
}
'const options = {
method: 'POST',
headers: {Version: '<version>', 'Content-Type': 'application/json'},
body: JSON.stringify({
altId: 'BQdAwxa0ky1iK2sstLGJ',
altType: 'location',
name: 'New Year Sale',
code: 'LEVELUPDAY2022',
discountType: 'amount',
discountValue: 10,
startDate: '2023-01-01T22:45:00.000Z',
endDate: '2023-01-31T22:45:00.000Z',
usageLimit: 10,
productIds: ['6241712be68f7a98102ba272'],
applyToFuturePayments: true,
applyToFuturePaymentsConfig: [{type: 'fixed', duration: 5, durationType: 'months'}, {type: 'forever'}],
limitPerCustomer: true
})
};
fetch('https://services.leadconnectorhq.com/payments/coupon', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://services.leadconnectorhq.com/payments/coupon"
payload = {
"altId": "BQdAwxa0ky1iK2sstLGJ",
"altType": "location",
"name": "New Year Sale",
"code": "LEVELUPDAY2022",
"discountType": "amount",
"discountValue": 10,
"startDate": "2023-01-01T22:45:00.000Z",
"endDate": "2023-01-31T22:45:00.000Z",
"usageLimit": 10,
"productIds": ["6241712be68f7a98102ba272"],
"applyToFuturePayments": True,
"applyToFuturePaymentsConfig": [{
"type": "fixed",
"duration": 5,
"durationType": "months"
}, { "type": "forever" }],
"limitPerCustomer": True
}
headers = {
"Version": "<version>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"_id": "67f6c132d9485f9dacd5f123",
"usageCount": 12,
"limitPerCustomer": 5,
"altId": "79t07PzK8Tvf73d12312",
"altType": "location",
"name": "NEWT6",
"code": "NEWT6",
"discountType": "percentage",
"discountValue": 25,
"status": "scheduled",
"startDate": "2025-04-30T18:30:00.000Z",
"applyToFuturePayments": true,
"applyToFuturePaymentsConfig": {
"type": "fixed",
"duration": 3,
"durationType": "months"
},
"createdAt": "2025-04-09T18:49:22.026Z",
"updatedAt": "2025-04-09T18:49:22.026Z",
"traceId": "c667b18d-8f5e-44cf-a914",
"endDate": "2025-05-30T18:30:00.000Z",
"userId": "q0m15dTLGeiGOXG123123"
}{
"statusCode": 422,
"message": [
"Unprocessable Entity"
],
"error": "Unprocessable Entity"
}Body
application/json
Response
Successful response
Last modified on March 8, 2026
Was this page helpful?
Create Coupon
curl --request POST \
--url https://services.leadconnectorhq.com/payments/coupon \
--header 'Content-Type: application/json' \
--header 'Version: <version>' \
--data '
{
"altId": "BQdAwxa0ky1iK2sstLGJ",
"altType": "location",
"name": "New Year Sale",
"code": "LEVELUPDAY2022",
"discountType": "amount",
"discountValue": 10,
"startDate": "2023-01-01T22:45:00.000Z",
"endDate": "2023-01-31T22:45:00.000Z",
"usageLimit": 10,
"productIds": [
"6241712be68f7a98102ba272"
],
"applyToFuturePayments": true,
"applyToFuturePaymentsConfig": [
{
"type": "fixed",
"duration": 5,
"durationType": "months"
},
{
"type": "forever"
}
],
"limitPerCustomer": true
}
'const options = {
method: 'POST',
headers: {Version: '<version>', 'Content-Type': 'application/json'},
body: JSON.stringify({
altId: 'BQdAwxa0ky1iK2sstLGJ',
altType: 'location',
name: 'New Year Sale',
code: 'LEVELUPDAY2022',
discountType: 'amount',
discountValue: 10,
startDate: '2023-01-01T22:45:00.000Z',
endDate: '2023-01-31T22:45:00.000Z',
usageLimit: 10,
productIds: ['6241712be68f7a98102ba272'],
applyToFuturePayments: true,
applyToFuturePaymentsConfig: [{type: 'fixed', duration: 5, durationType: 'months'}, {type: 'forever'}],
limitPerCustomer: true
})
};
fetch('https://services.leadconnectorhq.com/payments/coupon', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://services.leadconnectorhq.com/payments/coupon"
payload = {
"altId": "BQdAwxa0ky1iK2sstLGJ",
"altType": "location",
"name": "New Year Sale",
"code": "LEVELUPDAY2022",
"discountType": "amount",
"discountValue": 10,
"startDate": "2023-01-01T22:45:00.000Z",
"endDate": "2023-01-31T22:45:00.000Z",
"usageLimit": 10,
"productIds": ["6241712be68f7a98102ba272"],
"applyToFuturePayments": True,
"applyToFuturePaymentsConfig": [{
"type": "fixed",
"duration": 5,
"durationType": "months"
}, { "type": "forever" }],
"limitPerCustomer": True
}
headers = {
"Version": "<version>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"_id": "67f6c132d9485f9dacd5f123",
"usageCount": 12,
"limitPerCustomer": 5,
"altId": "79t07PzK8Tvf73d12312",
"altType": "location",
"name": "NEWT6",
"code": "NEWT6",
"discountType": "percentage",
"discountValue": 25,
"status": "scheduled",
"startDate": "2025-04-30T18:30:00.000Z",
"applyToFuturePayments": true,
"applyToFuturePaymentsConfig": {
"type": "fixed",
"duration": 3,
"durationType": "months"
},
"createdAt": "2025-04-09T18:49:22.026Z",
"updatedAt": "2025-04-09T18:49:22.026Z",
"traceId": "c667b18d-8f5e-44cf-a914",
"endDate": "2025-05-30T18:30:00.000Z",
"userId": "q0m15dTLGeiGOXG123123"
}{
"statusCode": 422,
"message": [
"Unprocessable Entity"
],
"error": "Unprocessable Entity"
}