Skip to main content
DELETE
/
customers
/
{external_customer_id}
/
applied_coupons
/
{applied_coupon_id}
LAGO_URL="https://api.getlago.com"
API_KEY="__YOUR_API_KEY__"

curl --location --request DELETE "$LAGO_URL/api/v1/customers/:external_customer_id/applied_coupons/:applied_coupon_id" \
  --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.destroy('external_customer_id', 'applied_coupon_id')
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.destroy('external_customer_id', 'applied_coupon_id')
await client.customers.deleteAppliedCoupon(
  "external_customer_id",
  "applied_coupon_id"
);
import "fmt"
import "github.com/getlago/lago-go-client"

func main() {
lagoClient := lago.New().
    SetApiKey("__YOUR_API_KEY__")

appliedCoupon, err := lagoClient.Coupon().AppliedCouponDelete('external_customer_id', 'applied_coupon_id')
if err != nil {
    // Error is *lago.Error
    panic(err)
}

// appliedCoupon is *lago.AppliedCoupon
fmt.Println(appliedCoupon)
}
{
  "applied_coupon": {
    "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",
    "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"
  }
}
{
"status": 401,
"error": "Unauthorized"
}
{
"status": 404,
"error": "Not Found",
"code": "object_not_found"
}
LAGO_URL="https://api.getlago.com"
API_KEY="__YOUR_API_KEY__"

curl --location --request DELETE "$LAGO_URL/api/v1/customers/:external_customer_id/applied_coupons/:applied_coupon_id" \
  --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.destroy('external_customer_id', 'applied_coupon_id')
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.destroy('external_customer_id', 'applied_coupon_id')
await client.customers.deleteAppliedCoupon(
  "external_customer_id",
  "applied_coupon_id"
);
import "fmt"
import "github.com/getlago/lago-go-client"

func main() {
lagoClient := lago.New().
    SetApiKey("__YOUR_API_KEY__")

appliedCoupon, err := lagoClient.Coupon().AppliedCouponDelete('external_customer_id', 'applied_coupon_id')
if err != nil {
    // Error is *lago.Error
    panic(err)
}

// appliedCoupon is *lago.AppliedCoupon
fmt.Println(appliedCoupon)
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

external_customer_id
string
required

The customer external unique identifier (provided by your own application)

Example:

"5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"

applied_coupon_id
string<uuid>
required

Unique identifier of the applied coupon, created by Lago.

Example:

"1a901a90-1a90-1a90-1a90-1a901a901a90"

Response

Successful response

applied_coupon
object
required