# Coupon application removed

Endpoint: POST coupon-application-removed
Version: latest
Security: SecretApiKey, JWT

## Request fields

- `couponId` (string)
  ID of the coupon.
- `redemptionId` (string)
  ID of the redemption.
- `customerId` (string)
  ID of the customer.
- `eventType` (string)
  Type of event that triggered the webhook.
  Enum: "coupon-application-removed", "coupon-applied", "coupon-redeemed", "coupon-redemption-canceled"
- `_embedded` (object)
  Embedded objects related to the coupon redemption event.
- `_embedded.coupon` (object)
  Coupons and discounts.
- `_embedded.coupon.discount` (object, required)
  Coupon discount.
- `_embedded.coupon.restrictions` (array)
  Coupon restrictions. All `type` values in this array must be unique.
- `_embedded.coupon.restrictions.type` (string, required)
  Type of coupon restriction.
  Enum: "total-redemptions"
- `_embedded.coupon.restrictions.quantity` (integer, required)
  Permitted number of discounts per redemption.
- `_embedded.coupon.restrictions.amount` (number, required)
  Maximum order amount that is allowed to apply the coupon.
- `_embedded.coupon.restrictions.currency` (string, required)
  Currency code in ISO 4217 format.
  Example: USD
- `_embedded.coupon.restrictions.amount` (number, required)
  Minimum order quantity that is required to apply the coupon.
- `_embedded.coupon.restrictions.time` (string, required)
  Date and time when a coupon redemption is no longer valid, and the coupon is removed from unpaid invoices if applied. > **Note:** This date-time cannot be changed.
- `_embedded.coupon.restrictions.quantity` (integer, required)
  Permitted number of redemptions per customer.
- `_embedded.coupon.restrictions.buy` (array, required)
  One or more plan and quantity definitions that must be purchased to receive all plans and quantities that are defined in the `get` instruction. All `planId` values in this array must be unique.
- `_embedded.coupon.restrictions.buy.planId` (string, required)
  Plan ID of the item being purchased. This value must be unique within the `buy.items` array.
  Example: plan_0YV7DENSVGDBW9S71XZNNYYQ0X
- `_embedded.coupon.restrictions.buy.quantity` (integer, required)
  Total quantity of the associated plan ID that must be purchased for this restriction to apply.
- `_embedded.coupon.restrictions.get` (array, required)
  One or more plan and quantity definitions that are added to a purchase if all definitions in the `buy` condition are met. All `planId` values in this array must be unique.
- `_embedded.coupon.restrictions.get.planId` (string, required)
  Plan ID of the item that is to be received by the customer. This value must be unique within the `get.items` array.
  Example: plan_0YV7DENSVGDBW9S71XZNNYYQ0X
- `_embedded.coupon.restrictions.get.quantity` (integer, required)
  Total quantity of the associated plan ID that is to be received by the customer.
- `_embedded.coupon.restrictions.countries` (array, required)
  Countries where the coupon can be applied, in ISO Alpha-2 code format. For examples, see [ISO.org](https://www.iso.org/obp/ui/#search/code/).
- `_embedded.coupon.restrictions.tags` (array, required)
  Customer tags on which a coupon can be applied.
- `_embedded.coupon.restrictions.requireAllTags` (boolean, required)
  Specifies if the customer must have all listed tags, or at least one of the listed tags, to redeem a coupon.
  Enum: true, false
- `_embedded.coupon.restrictions.customerIds` (array, required)
  Customer IDs on which a coupon can be applied.
- `_embedded.coupon.restrictions.invoiceIds` (array, required)
  Invoice IDs on which a coupon can be applied.
- `_embedded.coupon.restrictions.planIds` (array, required)
  Plan IDs on which a coupon can be applied.
- `_embedded.coupon.restrictions.minimumQuantity` (integer)
  Minimum quantity that is required to apply the restriction and subsequent discount.
- `_embedded.coupon.restrictions.productIds` (array, required)
  Product IDs on which a coupon can be applied.
- `_embedded.coupon.restrictions.subscriptionIds` (array, required)
  Subscription IDs on which a coupon can be applied.
- `_embedded.coupon.restrictions.quantity` (integer, required)
  Permitted total number of redemptions.
- `_embedded.coupon.description` (string)
  Description of the coupon. Use this field to provide a description for the invoice discount item. If this field is empty, the invoice discount item description uses the related coupon ID, in the following format: `Coupon "COUPON-ID"`.
- `_embedded.coupon.issuedTime` (string, required)
  Date and time when the coupon is issued. This value may also be described as start time of the coupon.
- `_embedded.coupon.expiredTime` (string | null)
  Date and time when the coupon expires.
- `_embedded.redemption` (object)
  Coupon redemption log.
- `_embedded.redemption.couponId` (string)
  ID of the coupon.
  Example: cpn_0YVCNKF81GD778N4YNVGDJK558
- `_embedded.redemption.customerId` (string)
  ID of the customer resource.
  Example: cus_0YV7DDSDD1C8DA64KHH2W33CPF
- `_embedded.redemption.additionalRestrictions` (array)
  Additional coupon redemption restrictions.
- `_embedded.customer` (object)
  Customer information.
- `_embedded.customer.websiteId` (string)
  ID of the website. A website is where an organization obtains a customer. For more information, see [Obtain an organization ID and website ID](https://www.rebilly.com/docs/settings/organizations-and-websites/#obtain-your-organization-id-and-website-id).
  Example: web_0YV7DE4Z26DQSA1AC92FBJ7SEG
- `_embedded.customer.paymentToken` (string)
  Write-only payment token. If supplied, the token is converted into a payment instrument, and its ID is assigned to `defaultPaymentInstrumentId` value. The value of this property overrides the `defaultPaymentInstrumentId` if both are supplied. This token may only be used once before it expires.
- `_embedded.customer.defaultPaymentInstrumentId` (string | null)
  ID of the customer's default payment instrument. The default payment instrument is used to automatically pay subscription renewals, and for transaction requests where a specific payment instrument is not provided.
  Example: inst_0YVB8KPKNXCBR9EDX7JHSED75N
- `_embedded.customer.preferredPayoutInstrumentId` (string | null)
  ID of the customer's preferred payment instrument for payouts.
  Example: inst_0YVB8KPKNXCBR9EDX7JHSED75N
- `_embedded.customer.customFields` (object)
  Use custom fields to extend a resource scheme to include custom data that is not provided as a common field. For more information, see [Custom fields](https://www.rebilly.com/catalog/all/custom-fields).
  Example: {"foo":"bar"}
- `_embedded.customer.primaryAddress` (any)
  Customer's primary address.
- `_embedded.customer.organizationId` (string)
  Unique organization identifier. An organization is an entity that represents a company. For more information, see [Obtain an organization ID](https://www.rebilly.com/docs/settings/organizations-and-websites/#obtain-your-organization-id-and-website-id).
  Example: org_0YVDM8RC7GDADADSBSMW124JA8
- `_embedded.customer.locale` (string | null)
  Language locale identifier in [RFC 5646](https://tools.ietf.org/html/rfc5646) format.
  Example: fr-FR
- `_embedded.customer.taxNumbers` (array | null)
  Tax numbers of the customer.
- `_embedded.customer.taxNumbers.type` (string, required)
  Type of the tax number.
  Enum: "eu-vat", "other"
- `_embedded.customer.taxNumbers.value` (string, required)
  Value of the tax number.
  Example: GB980780684
- `_embedded.customer.taxNumbers.isDefault` (boolean)
  Determines if the tax number is selected as default to display on invoices.
  Example: true
- `_embedded.customer.leadSource` (object)
  Lead source information.
- `_embedded.customer.leadSource.medium` (string | null)
  Category of the lead source traffic. For example, the medium could be organic search, Google ads, Display ads, and so on.
- `_embedded.customer.leadSource.source` (string | null)
  Domain, platform, or channel from which the lead source originates.
- `_embedded.customer.leadSource.campaign` (string | null)
  Campaign name of the lead source.
- `_embedded.customer.leadSource.term` (string | null)
  Term associated with a lead source.
- `_embedded.customer.leadSource.content` (string | null)
  Content contained in the lead source content. For example, content could be graphics, video, and so on.
- `_embedded.customer.leadSource.affiliate` (string | null)
  Individual or entity that is affiliated with the lead source.
- `_embedded.customer.leadSource.subAffiliate` (string | null)
  Individual or entity that is associated with a lead source affiliate. In other products, this field may also be referred to as sub ID or click ID in some.
- `_embedded.customer.leadSource.salesAgent` (string | null)
  Name of the sales agent associated with the lead source.
- `_embedded.customer.leadSource.clickId` (string | null)
  ID of the lead source click. This value is passed in the ad click URL for tracking and campaign attribution.
- `_embedded.customer.leadSource.path` (string | null)
  URL from which the lead source originates.
- `_embedded.customer.leadSource.referrer` (string | null)
  Lead source [`referrer` URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referer).
  Example: https://www.rebilly.com
- `_embedded.customer.personId` (string | null)
  ID of the associated person.
  Example: prs_0YV7DDSDD1C8DA64KHH2W33CPF
- `_embedded.customer.notificationEmails` (array)
  Email addresses for notification delivery in event-based email notifications. When you configure event-based email notifications, you can send to these addresses, the customer's primary email address, or another email address you specify. For more information, see [Manage notification emails](https://www.rebilly.com/docs/data-tables/manage-customer-information#manage-notification-emails).
- `_links` (array)
  Links to related resources.
- `_links.href` (string)
  URL of the link.
- `_links.rel` (string)
  Relationship type of the link.
  Enum: "coupon", "redemption", "customer"
