Skip to main content

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.

The “Update Coupon” API enables you to modify existing coupon details such as discount values, validity periods, usage limits, and other promotional parameters. Use this endpoint to adjust or extend promotional offers for your customers.
PUT https://services.leadconnectorhq.com/payments/coupon

Autorizacion

Authorization
string
required
Bearer token generado desde el portal Leadway. Ver Autenticacion.
Version
string
default:"2021-07-28"
required
Version de la API.

Body

altId
string
default:"BQdAwxa0ky1iK2sstLGJ"
required
Account Id
altType
string
default:"account"
required
Alt Type Posibles valores: ‘account’
name
string
default:"New Year Sale"
required
Coupon Name
code
string
default:"LEVELUPDAY2022"
required
Coupon Code
discountType
string
default:"amount"
required
Discount Type Posibles valores: ‘percentage’, ‘amount’
discountValue
number
default:"10"
required
Discount Value
startDate
string
default:"2023-01-01T22:45:00.000Z"
required
Start date in YYYY-MM-DDTHH:mm:ssZ format
endDate
string
default:"2023-01-31T22:45:00.000Z"
End date in YYYY-MM-DDTHH:mm:ssZ format
usageLimit
number
default:"10"
Max number of times coupon can be used
productIds
string[]
Product Ids
applyToFuturePayments
boolean
default:"True"
Is Coupon applicable on upcoming subscription transactions
applyToFuturePaymentsConfig
object
If coupon is applicable on upcoming subscription transactions, how many months should it be applicable for a subscription
limitPerCustomer
boolean
default:"True"
Limits whether a coupon can be redeemed only once per customer.
id
string
default:"6241712be68f7a98102ba272"
required
Coupon Id

Respuestas

_id
string
default:"67f6c132d9485f9dacd5f123"
required
Unique MongoDB identifier for the coupon
usageCount
number
default:"12"
required
Number of times the coupon has been used
limitPerCustomer
number
default:"5"
required
Maximum number of times a customer can use this coupon (0 for unlimited)
altId
string
default:"79t07PzK8Tvf73d12312"
required
Account Id
altType
string
default:"account"
required
Type of entity
name
string
default:"NEWT6"
required
Display name of the coupon
code
string
default:"NEWT6"
required
Redemption code for the coupon
discountType
string
default:"percentage"
required
Type of discount (percentage or amount) Posibles valores: ‘percentage’, ‘amount’
discountValue
number
default:"25"
required
Value of the discount (percentage or fixed amount)
status
string
default:"scheduled"
required
Current status of the coupon Posibles valores: ‘scheduled’, ‘active’, ‘expired’
startDate
string
default:"2025-04-30T18:30:00.000Z"
required
Date when the coupon becomes active
endDate
string
default:"2025-05-30T18:30:00.000Z"
End date when the coupon expires
applyToFuturePayments
boolean
default:"True"
required
Indicates if the coupon applies to future recurring payments
applyToFuturePaymentsConfig
object
required
Configuration for how the coupon applies to future payments
userId
string
default:"q0m15dTLGeiGOXG123123"
User ID associated with the coupon (if applicable)
createdAt
string
default:"2025-04-09T18:49:22.026Z"
required
Creation timestamp
updatedAt
string
default:"2025-04-09T18:49:22.026Z"
required
Last update timestamp
traceId
string
default:"c667b18d-8f5e-44cf-a914"
required
Unique identifier for tracing this API request
{
  "_id": "67f6c132d9485f9dacd5f123",
  "usageCount": 12,
  "limitPerCustomer": 5,
  "altId": "79t07PzK8Tvf73d12312",
  "altType": "account",
  "name": "NEWT6",
  "code": "NEWT6",
  "discountType": "percentage",
  "discountValue": 25,
  "status": "scheduled",
  "startDate": "2025-04-30T18:30:00.000Z",
  "endDate": "2025-05-30T18:30:00.000Z",
  "applyToFuturePayments": true,
  "userId": "q0m15dTLGeiGOXG123123",
  "createdAt": "2025-04-09T18:49:22.026Z",
  "updatedAt": "2025-04-09T18:49:22.026Z",
  "traceId": "c667b18d-8f5e-44cf-a914"
}
{}

Ejemplo

curl -X PUT '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",
  "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,
  "id": "6241712be68f7a98102ba272"
}'