# Coupon redemption canceled

Endpoint: POST coupon-redemption-canceled
Version: latest
Security: SecretApiKey, JWT

## Request fields (application/json):

  - `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) — one of (discriminator: type):
    Coupon discount.
    - fixed:
      - `amount` (number, required)
        Amount of discount.
      - `currency` (string, required)
        Currency code in ISO 4217 format.
      - `type` (string, required)
        Enum: "fixed"
      - `context` (string)
        Context in which the discount applies.
        Enum: "items", "shipping", "items-and-shipping"
    - percent:
      - `value` (number, required)
        Percentage of discount.
      - `type` (string, required)
        Enum: "percent"
      - `context` (string)
        Context in which the discount applies.
        Enum: same as `context` in "fixed" (3 values)

  - `_embedded.coupon.restrictions` (array) — one of (discriminator: type):
    Coupon restrictions.
All type values in this array must be unique.
    - discounts-per-redemption:
      - `type` (string, required)
        Type of coupon restriction.
        Enum: "discounts-per-redemption"
      - `quantity` (integer, required)
        Permitted number of discounts per redemption.
    - maximum-order-amount:
      - `type` (string, required)
        Type of coupon restriction.
        Enum: "maximum-order-amount"
      - `amount` (number, required)
        Maximum order amount that is allowed to apply the coupon.
      - `currency` (string, required)
        Currency code in ISO 4217 format.
    - minimum-order-amount:
      - `type` (string, required)
        Type of coupon restriction.
        Enum: "minimum-order-amount"
      - `amount` (number, required)
        Minimum order quantity that is required to apply the coupon.
      - `currency` (string, required)
        Currency code in ISO 4217 format.
    - paid-by-time:
      - `type` (string, required)
        Type of coupon restriction.
        Enum: "paid-by-time"
      - `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.
    - redemptions-per-customer:
      - `type` (string, required)
        Type of coupon restriction.
        Enum: "redemptions-per-customer"
      - `quantity` (integer, required)
        Permitted number of redemptions per customer.
    - restrict-to-bxgy:
      - `type` (string, required)
        Type of coupon restriction.
        Enum: "restrict-to-bxgy"
      - `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.
      - `buy.planId` (string, required)
        Plan ID of the item being purchased.
This value must be unique within the buy.items array.
        Example: "plan_0YV7DENSVGDBW9S71XZNNYYQ0X"
      - `buy.quantity` (integer, required)
        Total quantity of the associated plan ID that must be purchased for this restriction to apply.
      - `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.
      - `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"
      - `get.quantity` (integer, required)
        Total quantity of the associated plan ID that is to be received by the customer.
    - restrict-to-countries:
      - `type` (string, required)
        Type of coupon restriction.
        Enum: "restrict-to-countries"
      - `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/).
    - restrict-to-customer-tags:
      - `type` (string, required)
        Type of coupon restriction.
        Enum: "restrict-to-customer-tags"
      - `tags` (array, required)
        Customer tags on which a coupon can be applied.
      - `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
    - restrict-to-customers:
      - `type` (string, required)
        Type of coupon restriction.
        Enum: "restrict-to-customers"
      - `customerIds` (array, required)
        Customer IDs on which a coupon can be applied.
    - restrict-to-exclusive-application:
      - `type` (string, required)
        Type of coupon restriction.
        Enum: "restrict-to-exclusive-application"
    - restrict-to-invoices:
      - `type` (string, required)
        Type of coupon restriction.
        Enum: "restrict-to-invoices"
      - `invoiceIds` (array, required)
        Invoice IDs on which a coupon can be applied.
    - restrict-to-plans:
      - `type` (string, required)
        Type of coupon restriction.
        Enum: "restrict-to-plans"
      - `planIds` (array, required)
        Plan IDs on which a coupon can be applied.
      - `minimumQuantity` (integer)
        Minimum quantity that is required to apply the restriction and subsequent discount.
    - restrict-to-products:
      - `type` (string, required)
        Type of coupon restriction.
        Enum: "restrict-to-products"
      - `productIds` (array, required)
        Product IDs on which a coupon can be applied.
      - `minimumQuantity` (integer)
        Minimum quantity that is required to apply the restriction and subsequent discount.
    - restrict-to-subscriptions:
      - `type` (string, required)
        Type of coupon restriction.
        Enum: "restrict-to-subscriptions"
      - `subscriptionIds` (array, required)
        Subscription IDs on which a coupon can be applied.
    - total-redemptions:
      - `type` (string, required)
        Type of coupon restriction.
        Enum: "total-redemptions"
      - `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.

  - `_embedded.redemption.additionalRestrictions` (array) — one of (discriminator: type):
    Additional coupon redemption restrictions.
    - discounts-per-redemption:
      - `type` (string, required)
        Type of coupon restriction.
        Enum: same as `type` in "discounts-per-redemption" (1 values)
      - `quantity` (integer, required)
        Permitted number of discounts per redemption.
    - maximum-order-amount:
      - `type` (string, required)
        Type of coupon restriction.
        Enum: same as `type` in "maximum-order-amount" (1 values)
      - `amount` (number, required)
        Maximum order amount that is allowed to apply the coupon.
      - `currency` (string, required)
        Currency code in ISO 4217 format.
    - minimum-order-amount:
      - `type` (string, required)
        Type of coupon restriction.
        Enum: same as `type` in "minimum-order-amount" (1 values)
      - `amount` (number, required)
        Minimum order quantity that is required to apply the coupon.
      - `currency` (string, required)
        Currency code in ISO 4217 format.
    - paid-by-time:
      - `type` (string, required)
        Type of coupon restriction.
        Enum: same as `type` in "paid-by-time" (1 values)
      - `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.
    - restrict-to-invoices:
      - `type` (string, required)
        Type of coupon restriction.
        Enum: same as `type` in "restrict-to-invoices" (1 values)
      - `invoiceIds` (array, required)
        Invoice IDs on which a coupon can be applied.
    - restrict-to-plans:
      - `type` (string, required)
        Type of coupon restriction.
        Enum: same as `type` in "restrict-to-plans" (1 values)
      - `planIds` (array, required)
        Plan IDs on which a coupon can be applied.
      - `minimumQuantity` (integer)
        Minimum quantity that is required to apply the restriction and subsequent discount.
    - restrict-to-products:
      - `type` (string, required)
        Type of coupon restriction.
        Enum: same as `type` in "restrict-to-products" (1 values)
      - `productIds` (array, required)
        Product IDs on which a coupon can be applied.
      - `minimumQuantity` (integer)
        Minimum quantity that is required to apply the restriction and subsequent discount.
    - restrict-to-subscriptions:
      - `type` (string, required)
        Type of coupon restriction.
        Enum: same as `type` in "restrict-to-subscriptions" (1 values)
      - `subscriptionIds` (array, required)
        Subscription IDs on which a coupon can be applied.

  - `_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 set as the defaultPaymentInstrument value.
If both are supplied, the value of this property overrides the defaultPaymentInstrument value.
The token expires after first use.

  - `_embedded.customer.defaultPaymentInstrument` (object,null) — one of:
    - Vaulted payment instrument:
      - `method` (string, required)
        Payment method supported vault.
For more information, see [Payment instrument](https://www.rebilly.com/catalog/all/payment-instruments).
        Enum: "payment-card", "ach", "paypal"
      - `paymentInstrumentId` (string, required)
        ID of the payment instrument.
        Example: "inst_0YVB8KPKNXCBR9EDX7JHSED75N"
    - Alternative instrument:
      - `method` (string, required)
        Payment method.
        Enum: "payment-card", "ach", "cash", "check", "paypal", "AdvCash", "Aera", "Affirm", "Afterpay", "Aircash", "Airpay", "Alfa-click", "Alipay", "AmazonPay", "Apple Pay", "AstroPay Card", "AstroPay-GO", "BankSEND", "BankReferenced", "bank-transfer", "bank-transfer-2", "bank-transfer-3", "bank-transfer-4", "bank-transfer-5", "bank-transfer-6", "bank-transfer-7", "bank-transfer-8", "bank-transfer-9", "Baloto", "Beeline", "Belfius-direct-net", "bitcoin", "Bizum", "Blik", "Boleto", "Boleto-2", "Boleto-3", "cash-deposit", "CASHlib", "CashToCode", "CCAvenue", "China UnionPay", "Clearpay", "Cleo", "CODVoucher", "Conekta-oxxo", "Conekta-spei", "cryptocurrency", "Cupon-de-pagos", "CyberSource", "Dimoco-pay-smart", "Directa24Card", "domestic-cards", "Efecty", "echeck", "ecoPayz", "ecoPayzTurkey", "ecoVoucher", "EPS", "ePay.bg", "Ethereum", "e-wallet", "ezyEFT", "eZeeWallet", "FasterPay", "Flexepin", "Giropay", "Google Pay", "Gpaysafe", "iCashOne Voucher", "iDebit", "iDEAL", "ING-homepay", "INOVAPAY-pin", "INOVAPAY-wallet", "InstaDebit", "InstantPayments", "instant-bank-transfer", "Interac-online", "Interac-eTransfer", "Interac-express-connect", "Interac", "invoice", "iWallet", "Jeton", "JetonCash", "jpay", "KakaoPay", "Khelocard", "Klarna", "KNOT", "Litecoin", "loonie", "LPG-online", "LPG-payment-card", "Matrix", "MaxiCash", "Megafon", "MercadoPago", "MiFinity-eWallet", "miscellaneous", "MobilePay", "Mollie", "Multibanco", "Bancontact", "Bancontact-mobile", "MTS", "MuchBetter", "MuchBetterVoucher", "MyFatoorah", "Neosurf", "Netbanking", "Neteller", "Nordea-Solo", "NordikCoin", "OchaPay", "online-bank-transfer", "Onlineueberweisen", "oriental-wallet", "OXXO", "P24", "Pagadito", "PagoEffectivo", "Pagsmile-lottery", "Pagsmile-deposit-express", "PayCash", "Payco", "Payeer", "PaymentAsia-crypto", "Paysafecard", "PayTabs", "Pay4Fun", "Paynote", "Paymero", "Paymero-QR", "PayU", "PayULatam", "Perfect-money", "Piastrix", "PIX", "PinPay", "phone", "PhonePe", "POLi", "PostFinance-card", "PostFinance-e-finance", "QIWI", "QPay", "QQPay", "Quickpay", "rapyd-checkout", "rebilly-hosted-payment-form", "Resurs", "reverse-withdrawal", "Ripple", "SafetyPay", "Samsung Pay", "SEPA", "Siirto", "Skrill", "Skrill Rapid Transfer", "SMSVoucher", "Sofort", "SparkPay", "SPEI", "swift-dbt", "Tele2", "Telr", "Terminaly-RF", "Tether", "ToditoCash-card", "Trustly", "Tupay", "TWINT", "UniCrypt", "UPayCard", "UPI", "USD-coin", "VCreditos", "VegaWallet", "VenusPoint", "Viva", "voucher", "voucher-2", "voucher-3", "voucher-4", "Wallet88", "Webmoney", "Webpay", "Webpay-2", "Webpay Card", "WeChat Pay", "XPay-P2P", "XPay-QR", "Yandex-money", "Zotapay", "Zimpler", "Zip"
      - `paymentInstrumentId` (string)
        ID of the payment instrument.
        Example: "inst_0YVB8KPKNXCBR9EDX7JHSED75N"
      - `reference` (string,null)
        Reference data.
This field is available only for the bank-transfer payment method.
    - Cash:
      - `method` (string, required)
        Enum: "cash"
      - `receivedBy` (string)
        Individual or entity that received the payment.
    - Check:
      - `method` (string, required)
        Enum: "check"
      - `reference` (string)
        Reference data.

  - `_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).

  - `_embedded.customer.primaryAddress` (any)
    Customer's primary address.
    - `firstName` (string,null)
      Contact's first name.
      Example: "Benjamin"
    - `lastName` (string,null)
      Contact's last name.
      Example: "Franklin"
    - `organization` (string,null)
      Contact's organization.
      Example: "Rebilly"
    - `address` (string,null)
      First line of the contact's street address.
      Example: "36 Craven St"
    - `address2` (string,null)
      Second line of the contact's street address.
    - `city` (string,null)
      Contact's city of residence.
      Example: "Austin"
    - `region` (string,null)
      Contact's region of residence.
      Example: "Texas"
    - `country` (string,null)
      Contact's country of residence in ISO 3166 alpha-2 country code.
For examples, see [ISO.org](https://www.iso.org/obp/ui/#search/code/).
      Example: "GB"
    - `postalCode` (string,null)
      Contact's postal code.
      Example: "WC2N 5NF"
    - `phoneNumbers` (array)
      List of phone numbers associated with the contact.
    - `phoneNumbers.label` (string, required)
      Phone number label or name.
      Example: "main"
    - `phoneNumbers.value` (string, required)
      Phone number value.
      Example: "1-512-777-0269"
    - `phoneNumbers.primary` (boolean)
      Specifies if the phone number is the contact's primary phone number.
      Example: true
    - `emails` (array)
      List of email addresses associated with the contact.
    - `emails.label` (string, required)
      Email label or name.
      Example: "main"
    - `emails.value` (string, required)
      Email address value.
      Example: "rebilly@example.com"
    - `emails.primary` (boolean)
      Specifies if the email address is the contact's primary email address.
      Example: true
    - `dob` (string,null)
      Contact's date of birth in ISO-8601 YYYY-MM-DD format.
      Example: "1980-04-01"
    - `jobTitle` (string,null)
      Contact's job title.
      Example: "CEO"

  - `_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)
    Additional email addresses for notification delivery.

  - `_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"


## Response 2xx fields
