Skip to main content

Update coupon

Route

PUT
/api/v1/coupons/:code

Usage

LAGO_URL="https://api.getlago.com"
API_KEY="__YOUR_API_KEY__"

curl --location --request PUT "$LAGO_URL/api/v1/coupons/:code" \
--header "Authorization: Bearer $API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"coupon": {
"name": "coupon_name",
"code": "coupon_code",
"amount_cents": 5000,
"amount_currency": "USD",
"expiration": "time_limit",
"expiration_duration": 10
}
}'

Arguments

{
"coupon": {
"name": "coupon_name",
"code": "coupon_code",
"amount_cents": 5000,
"amount_currency": "USD",
"expiration": "time_limit",
"expiration_duration": 10
}
}
AttributesTypeDescription
nameString      OptionalCoupon name
codeString      OptionalCode identifying the coupon
It won't be updated if coupon is attached to any subscriptions
amount_centsInteger      OptionalAmount of the coupon
It won't be updated if coupon is attached to any subscriptions
amount_currencyString      OptionalCurrency of the amount
It won't be updated if coupon is attached to any subscriptions
expirationString      OptionalExpiration type.
It can be time_limit or no_expiration
It won't be updated if coupon is attached to any subscriptions
expiration_durationInteger      OptionalCoupon duration
It won't be updated if coupon is attached to any subscriptions

Responses

The coupon was successfully updated

Returns a coupon object.