Skip to main content

Create coupon

Route

POST
/api/v1/coupons

Usage

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

curl --location --request POST "$LAGO_URL/api/v1/coupons" \
--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      RequiredCoupon name
codeString      RequiredCode identifying the coupon
amount_centsInteger      RequiredAmount of the coupon
amount_currencyString      RequiredCurrency of the amount
expirationString      RequiredExpiration type.
It can be time_limit or no_expiration
expiration_durationInteger      Required (optional only for no_expiration type)Coupon duration.

Responses

The coupon was created

Returns a coupon object.