coupons

Apply a coupon to a customer

Changed on

This endpoint is used to apply a specific coupon to a customer, before or during a subscription.

post/applied_coupons

Request

Request body

Example request

{
  "applied_coupon": {
    "external_customer_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
    "coupon_code": "startup_deal",
    "frequency": "recurring",
    "frequency_duration": 3,
    "amount_cents": 2000,
    "amount_currency": "USD"
  }
}

Response

Coupon applied

Example response

{
  "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",
    "coupon_description": "I am a coupon description",
    "coupon_status": "active",
    "coupon_deleted_at": "2022-04-29T08:59:51Z",
    "lago_customer_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
    "external_customer_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
    "status": "active",
    "amount_cents": 2000,
    "amount_cents_remaining": 50,
    "amount_currency": "USD",
    "frequency": "recurring",
    "frequency_duration": 3,
    "frequency_duration_remaining": 1,
    "expiration_at": "2022-04-29T08:59:51Z",
    "created_at": "2022-04-29T08:59:51Z",
    "terminated_at": "2022-04-29T08:59:51Z"
  }
}

Changes

    • breaking

      the / request property type changed from string null to string number null

    • info

      added the non-success response with the status

    • warning

      added the new SYP enum value to the / response property for the response status

    • warning

      added the new TND enum value to the / response property for the response status

    • info

      added the new SYP enum value to the request property /

    • info

      added the new TND enum value to the request property /

    • info

      added the optional property / to the response with the status

    • info

      the response property / became required for the status