LAGO_URL="https://api.getlago.com"
API_KEY="__YOUR_API_KEY__"
curl --location --request GET "$LAGO_URL/api/v1/applied_coupons?per_page=2&page=1" \
--header "Authorization: Bearer $API_KEY"
from lago_python_client.client import Client
from lago_python_client.exceptions import LagoApiError
client = Client(api_key='__YOUR_API_KEY__')
try:
client.applied_coupons.find_all({'per_page': 2, 'page': 1})
except LagoApiError as e:
repair_broken_state(e) # do something on error or raise your own exception
require 'lago-ruby-client'
client = Lago::Api::Client.new(api_key: '__YOUR_API_KEY__')
client.applied_coupons.get_all({ per_page: 2, page: 3 })
await client.appliedCoupons.findAllAppliedCoupons({ per_page: 2, page: 3 });
import "fmt"
import "github.com/getlago/lago-go-client"
func main() {
lagoClient := lago.New().
SetApiKey("__YOUR_API_KEY__")
couponListInput := &lago.AppliedCouponListInput{
PerPage: 1,
Page: 1,
}
couponResult, err := lagoClient.AppliedCoupon().GetList(couponListInput)
if err != nil {
// Error is *lago.Error
panic(err)
}
// couponResult is *lago.CouponResult
fmt.Println(couponResult)
}
{
"applied_coupons": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"lago_coupon_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"coupon_code": "startup_deal",
"coupon_name": "Startup Deal",
"lago_customer_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"external_customer_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
"status": "active",
"frequency": "recurring",
"created_at": "2022-04-29T08:59:51Z",
"credits": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"amount_cents": 1200,
"amount_currency": "EUR",
"before_taxes": false,
"item": {
"lago_item_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"type": "coupon",
"code": "startup_deal",
"name": "Startup Deal"
},
"invoice": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"payment_status": "succeeded"
}
}
],
"coupon_status": "active",
"coupon_deleted_at": "2022-04-29T08:59:51Z",
"amount_cents": 2000,
"amount_cents_remaining": 50,
"amount_currency": "EUR",
"percentage_rate": null,
"frequency_duration": 3,
"frequency_duration_remaining": 1,
"expiration_at": "2022-04-29T08:59:51Z",
"terminated_at": "2022-04-29T08:59:51Z"
}
],
"meta": {
"current_page": 2,
"total_pages": 4,
"total_count": 70,
"next_page": 3,
"prev_page": 1
}
}{
"status": 401,
"error": "Unauthorized"
}Coupons
List all applied coupons
This endpoint is used to list all applied coupons. You can filter by coupon status and by customer.
GET
/
applied_coupons
LAGO_URL="https://api.getlago.com"
API_KEY="__YOUR_API_KEY__"
curl --location --request GET "$LAGO_URL/api/v1/applied_coupons?per_page=2&page=1" \
--header "Authorization: Bearer $API_KEY"
from lago_python_client.client import Client
from lago_python_client.exceptions import LagoApiError
client = Client(api_key='__YOUR_API_KEY__')
try:
client.applied_coupons.find_all({'per_page': 2, 'page': 1})
except LagoApiError as e:
repair_broken_state(e) # do something on error or raise your own exception
require 'lago-ruby-client'
client = Lago::Api::Client.new(api_key: '__YOUR_API_KEY__')
client.applied_coupons.get_all({ per_page: 2, page: 3 })
await client.appliedCoupons.findAllAppliedCoupons({ per_page: 2, page: 3 });
import "fmt"
import "github.com/getlago/lago-go-client"
func main() {
lagoClient := lago.New().
SetApiKey("__YOUR_API_KEY__")
couponListInput := &lago.AppliedCouponListInput{
PerPage: 1,
Page: 1,
}
couponResult, err := lagoClient.AppliedCoupon().GetList(couponListInput)
if err != nil {
// Error is *lago.Error
panic(err)
}
// couponResult is *lago.CouponResult
fmt.Println(couponResult)
}
{
"applied_coupons": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"lago_coupon_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"coupon_code": "startup_deal",
"coupon_name": "Startup Deal",
"lago_customer_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"external_customer_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
"status": "active",
"frequency": "recurring",
"created_at": "2022-04-29T08:59:51Z",
"credits": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"amount_cents": 1200,
"amount_currency": "EUR",
"before_taxes": false,
"item": {
"lago_item_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"type": "coupon",
"code": "startup_deal",
"name": "Startup Deal"
},
"invoice": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"payment_status": "succeeded"
}
}
],
"coupon_status": "active",
"coupon_deleted_at": "2022-04-29T08:59:51Z",
"amount_cents": 2000,
"amount_cents_remaining": 50,
"amount_currency": "EUR",
"percentage_rate": null,
"frequency_duration": 3,
"frequency_duration_remaining": 1,
"expiration_at": "2022-04-29T08:59:51Z",
"terminated_at": "2022-04-29T08:59:51Z"
}
],
"meta": {
"current_page": 2,
"total_pages": 4,
"total_count": 70,
"next_page": 3,
"prev_page": 1
}
}{
"status": 401,
"error": "Unauthorized"
}LAGO_URL="https://api.getlago.com"
API_KEY="__YOUR_API_KEY__"
curl --location --request GET "$LAGO_URL/api/v1/applied_coupons?per_page=2&page=1" \
--header "Authorization: Bearer $API_KEY"
from lago_python_client.client import Client
from lago_python_client.exceptions import LagoApiError
client = Client(api_key='__YOUR_API_KEY__')
try:
client.applied_coupons.find_all({'per_page': 2, 'page': 1})
except LagoApiError as e:
repair_broken_state(e) # do something on error or raise your own exception
require 'lago-ruby-client'
client = Lago::Api::Client.new(api_key: '__YOUR_API_KEY__')
client.applied_coupons.get_all({ per_page: 2, page: 3 })
await client.appliedCoupons.findAllAppliedCoupons({ per_page: 2, page: 3 });
import "fmt"
import "github.com/getlago/lago-go-client"
func main() {
lagoClient := lago.New().
SetApiKey("__YOUR_API_KEY__")
couponListInput := &lago.AppliedCouponListInput{
PerPage: 1,
Page: 1,
}
couponResult, err := lagoClient.AppliedCoupon().GetList(couponListInput)
if err != nil {
// Error is *lago.Error
panic(err)
}
// couponResult is *lago.CouponResult
fmt.Println(couponResult)
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Page number.
Example:
1
Number of records per page.
Example:
20
The status of the coupon. Can be either active or terminated.
Available options:
active, terminated Example:
"active"
The customer external unique identifier (provided by your own application)
Example:
"5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
The code of the coupon applied to the customer. Use it to filter applied coupons by their code.
Example:
["BLACK_FRIDAY_2024", "CHRISTMAS_2024"]⌘I