A coupon has been updated

A coupon has been updated

postWebhookcoupon_updated

Headers

X-Lago-Signaturestring required
Example:AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8=

Signature of the webhook payload. The format depends on X-Lago-Signature-Algorithm: hmac is the Base64 encoding of an HMAC-SHA256 digest of the payload, jwt is an RS256 JSON Web Token (a string starting with eyJ).

X-Lago-Signature-Algorithm'jwt' | 'hmac' required
Example:hmac

Algorithm used to generate the signature

X-Lago-Unique-Keystring uuid required
Example:1a901a90-1a90-1a90-1a90-1a901a901a90

Unique id of the webhook. It can be used for idempotency

Payload

webhook_type'coupon.updated' required
object_type'coupon' required
organization_idstring uuid required

Unique identifier of the organization, created by Lago.

Example payload

{
  "organization_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
  "coupon": {
    "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
    "name": "Startup Deal",
    "code": "startup_deal",
    "description": "I am a coupon description",
    "coupon_type": "fixed_amount",
    "amount_cents": 5000,
    "amount_currency": "USD",
    "reusable": true,
    "limited_plans": true,
    "plan_codes": [
      "startup_plan"
    ],
    "billable_metric_codes": [],
    "frequency": "recurring",
    "frequency_duration": 6,
    "expiration": "time_limit",
    "expiration_at": "2022-08-08T23:59:59Z",
    "created_at": "2022-04-29T08:59:51Z",
    "terminated_at": "2022-08-08T23:59:59Z"
  }
}

Response

Return a 200 status to indicate that the data was received successfully

Changes

Webhooks have no change history: a webhook is keyed by its event name rather than a path and method, so no recorded change can name it.