Coupons
Apply a coupon
This endpoint is used to apply a specific coupon to a customer, before or during a subscription.
POST
/
applied_coupons
Authorization
Body
LAGO_URL="https://api.getlago.com"
API_KEY="__YOUR_API_KEY__"
curl --location --request POST "$LAGO_URL/api/v1/applied_coupons" \
--header "Authorization: Bearer $API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"applied_coupon": {
"external_customer_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
"coupon_code": "startup_deal",
"amount_cents": 2500,
"amount_currency": "EUR",
"frequency": "recurring",
"frequency_duration": 3
}
}'
{
"applied_coupon": {
"amount_cents": 2000,
"amount_cents_remaining": 50,
"amount_currency": "EUR",
"coupon_code": "startup_deal",
"coupon_name": "Startup Deal",
"created_at": "2022-04-29T08:59:51Z",
"expiration_at": "2022-04-29T08:59:51Z",
"external_customer_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
"frequency": "recurring",
"frequency_duration": 3,
"frequency_duration_remaining": 1,
"lago_coupon_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"lago_customer_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"percentage_rate": "null",
"status": "active",
"terminated_at": "2022-04-29T08:59:51Z"
}
}
Authorizations
Authorization
string
headerrequiredBearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
application/json
applied_coupon
object
requiredResponse
200 - application/json
applied_coupon
object
requiredWas this page helpful?
LAGO_URL="https://api.getlago.com"
API_KEY="__YOUR_API_KEY__"
curl --location --request POST "$LAGO_URL/api/v1/applied_coupons" \
--header "Authorization: Bearer $API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"applied_coupon": {
"external_customer_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
"coupon_code": "startup_deal",
"amount_cents": 2500,
"amount_currency": "EUR",
"frequency": "recurring",
"frequency_duration": 3
}
}'
{
"applied_coupon": {
"amount_cents": 2000,
"amount_cents_remaining": 50,
"amount_currency": "EUR",
"coupon_code": "startup_deal",
"coupon_name": "Startup Deal",
"created_at": "2022-04-29T08:59:51Z",
"expiration_at": "2022-04-29T08:59:51Z",
"external_customer_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
"frequency": "recurring",
"frequency_duration": 3,
"frequency_duration_remaining": 1,
"lago_coupon_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"lago_customer_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"percentage_rate": "null",
"status": "active",
"terminated_at": "2022-04-29T08:59:51Z"
}
}