# Credit memo applied

Endpoint: POST credit-memo-applied
Version: latest
Security: SecretApiKey, JWT

## Security:

  - `SecretApiKey` (unknown)
    apiKey in header REB-APIKEY

  - `JWT` (unknown)
    http bearer JWT

## Request body:

  - `application/json` (unknown)
    Payload of credit memo-related webhook event.

## Request fields (application/json):

  - `creditMemoId` (string)
    ID of the credit memo.
    Example: crmm_0YVCNN22TWC3G8H82QNPNVZCHG

  - `eventType` (string)
    Type of event that triggered the webhook.
    Enum: "credit-memo-applied", "credit-memo-created", "credit-memo-modified", "credit-memo-partially-applied", "credit-memo-voided"

  - `_embedded` (object)
    Embedded objects related to the credit memo event.

  - `_embedded.creditMemo` (object)
    Credit memo object.

  - `_embedded.creditMemo.allocations` (object)
    Allocations reduce the unused amount of a credit memo.

  - `_embedded.creditMemo.allocations.transactions` (array)
    List of transactions (typically refunds, credits, and chargebacks) that are allocated to reduce the unused amount of a credit memo.
- To delete transaction allocations, send an empty transaction allocation array in the request.
- To modify transaction allocations, send a modified transaction allocation array in the request.
- If you do not want to modify or delete transaction allocations, do not send a transaction allocation array in the request.

  - `_embedded.creditMemo.allocations.transactions.transactionId` (string)
    ID of the transaction.
    Example: txn_0YVDTQJ8YWDGQACV2N2N5SPWQ0

  - `_embedded.creditMemo.allocations.transactions.amount` (number)
    Amount of credit that is allocated from the credit memo to the transaction.
If the `amount` value is not supplied or exceeds the unused amount of the credit memo or the transaction amount, the lesser of the following two values is used:
- The unused amount of the credit memo.
- The transaction amount.

  - `_embedded.creditMemo.allocations.transactions.currency` (string)
    Currency code in ISO 4217 format.
    Example: USD

  - `_embedded.creditMemo.allocations.invoices` (array)
    List of invoices that the credit memo is allocated to.
- To delete invoice allocations, send an empty invoice allocation array in the request.
Only `unpaid`, `partially-paid`, and `past-due` invoices can be deleted.
- To modify invoice allocations, send a modified invoice allocation array in the request.
Only `unpaid`, `partially-paid`, and `past-due` invoices can be modified.
- If you do not want to modify or delete invoice allocations, do not send an invoice allocation array in the request.

  - `_embedded.creditMemo.allocations.invoices.invoiceId` (string)
    ID of invoice to which the credit memo is allocated.
    Example: in_0YVF9605RKC62BP14NE2R7V2XT

  - `_embedded.creditMemo.allocations.invoices.amount` (number)
    Amount of credit that is allocated from the credit memo to the invoice.
If the `amount` value is not supplied or exceeds the unused amount of the credit memo or the invoice due amount, the lesser of the following two values is used:
- The unused amount of the credit memo.
- The invoice due amount.

  - `_embedded.creditMemo.items` (array)
    Items of the credit memo.

  - `_embedded.creditMemo.items.invoiceItemId` (string | null)
    ID of the invoice item to which the credit item is referenced.
    Example: ii_0YVFDEQS2KCFTBN9HXWJFY55GV

  - `_embedded.creditMemo.items.description` (string)
    Description of the credit memo item.

  - `_embedded.creditMemo.items.unitPrice` (number, required)
    Price of the credit memo item.

  - `_embedded.creditMemo.items.quantity` (integer, required)
    Quantity of the credit memo item.

  - `_embedded.creditMemo.items.productId` (string | null)
    ID of the related product.
    Example: prod_0YV7DES3WPC5J8JD8QTVNZBZNZ

  - `_embedded.creditMemo.items.planId` (string | null)
    ID of the related plan.
    Example: plan_0YV7DENSVGDBW9S71XZNNYYQ0X

  - `_embedded.creditMemo.items.tax` (any)
    Credit memo item tax.

  - `_embedded.creditMemo.items.tax.amount` (number, required)
    Amount of the tax.

  - `_embedded.creditMemo.items.tax.description` (string, required)
    Description of the tax.

  - `_embedded.creditMemo.items.tax.rate` (number | null)
    Overall sales tax rate which includes state, county, city and district tax.

  - `_embedded.creditMemo.items.tax.stateAmount` (number | null)
    Amount of sales tax to collect for the state.
    Example: 0.94

  - `_embedded.creditMemo.items.tax.countyAmount` (number | null)
    Amount of sales tax to collect for the county.
    Example: 0.04

  - `_embedded.creditMemo.items.tax.cityAmount` (number | null)
    Amount of sales tax to collect for the city.
    Example: 0

  - `_embedded.creditMemo.items.tax.specialDistrictAmount` (number | null)
    Amount of sales tax to collect for the special district.
    Example: 0.38

  - `_embedded.creditMemo.items.tax.stateRate` (number | null)
    State sales tax rate for given location.

  - `_embedded.creditMemo.items.tax.countyRate` (number | null)
    County sales tax rate for given location.

  - `_embedded.creditMemo.items.tax.cityRate` (number | null)
    City sales tax rate for given location.

  - `_embedded.creditMemo.items.tax.specialDistrictRate` (number | null)
    Special district sales tax rate for given location.

  - `_embedded.creditMemo.items.tax.jurisdictions` (object | null)
    Jurisdiction names for the invoice.

  - `_embedded.creditMemo.items.tax.jurisdictions.country` (string | null)
    Two-letter ISO country code for the provided location.
    Example: US

  - `_embedded.creditMemo.items.tax.jurisdictions.state` (string | null)
    Postal abbreviated state name for the provided location.
    Example: CA

  - `_embedded.creditMemo.items.tax.jurisdictions.county` (string | null)
    County name for the provided location.
    Example: LOS ANGELES

  - `_embedded.creditMemo.items.tax.jurisdictions.city` (string | null)
    City name for the provided location.
    Example: LOS ANGELES

  - `_embedded.creditMemo.reason` (string)
    Reason for the credit memo.
    Enum: "return", "product-unsatisfactory", "order-change", "order-cancellation", "chargeback", "write-off", "waiver", "customer-credit", "prepayment", "other"

  - `_embedded.creditMemo.description` (string)
    Public description, that is visible to customers, which describes the purpose of the credit memo.

  - `_embedded.creditMemo.shippingAmount` (number)
    Shipping amount of an invoice to credit.

  - `_embedded.creditMemo.customerId` (string, required)
    ID of the customer resource.
    Example: cus_0YV7DDSDD1C8DA64KHH2W33CPF

  - `_embedded.creditMemo.invoiceId` (string | null)
    ID of the invoice to which the credit memo is issued.
    Example: in_0YVF9605RKC62BP14NE2R7V2XT

  - `_links` (array)
    Links to related resources.

  - `_links.href` (string)
    URL of the link.

  - `_links.rel` (string)
    Relationship type of the link.
    Enum: "creditMemo"

## Response 2xx:

  - `2xx` (unknown)
    Returns any 2xx status to indicate that data is received.

