# Credit notes

> For the complete machine-readable documentation index, see [llms.txt](https://apidocs.chargebee.com/llms.txt).


A [Credit Note](https://www.chargebee.com/docs/credit-notes.html) is a document that specifies the money owed by a business to its customer. The seller usually issues a Credit Note for the same or lower amount than the invoice, and then repays the money to the customer or set it off against other 'due' invoices.

### Credit Note Types[](#credit-note-types)

Credit notes in Chargebee are categorized into three types: 1. `adjustment`: Adjustment credit notes are used to adjust the amount of an existing invoice in the `payment_due` or `not_paid` [status](/docs/api/invoices/invoice-object#status). Use this type of credit note to reduce the invoice amount, typically as a discount to the customer.  
Adjustment credit notes are automatically created in the following cases:

-   When an invoice is written off.
-   When a subscription is modified with proration enabled, and the invoice for the current term is in the `payment_due` or `not_paid` [status](/docs/api/invoices/invoice-object#status). 2. `refundable`: Refundable credit notes allow you to return a certain amount to the customer. These credits can be:
-   Retained for automatic application on future invoices.
-   Applied to existing unpaid invoices.
-   Refunded to the customer. Refundable credit notes are automatically created in the following cases:
-   When an invoice is refunded.
-   When a subscription is changed or canceled with proration enabled, the invoice for the current term is in the `paid` [status](/docs/api/invoices/invoice-object#status). Refundable credits are applied to future invoices or can be refunded to the original payment method. 3. `store`: Store credit notes are created for `paid` or `partially_paid` invoice [status](/docs/api/invoices/invoice-object#status) during subscription changes, such as upgrades, downgrades, or cancellations. Key characteristics of store credits:
-   No tax component is included at the time of creation.
-   A credit note document is generated, similar to refundable credits.
-   Store credits are applied before tax calculations on future invoices.

**Note:** If you have enabled _consolidated invoicing_ , to know the subscriptions attached with a credit note you have to refer [line\_item's](/docs/api/credit_notes/credit_note-object#line_items) _subscription\_id_ . The credit note's _subscription\_id_ should **not** be used (which will be _null_ if the credit note has lines from multiple subscriptions).

Impact on reference invoice

The following updates are made to the reference invoice when a credit note is created/imported:

-   If the credit note `type` is `adjustment`:
    -   The adjustment credit note details are added to the `adjustment_credit_notes[]` attribute of the invoice.
    -   The invoice `amount_due` is reduced by the credit note `total`.
    -   The invoice `status` is updated to `paid` if the invoice `amount_due` equals the credit note `total`.
    -   The invoice `status` does not change if the invoice `amount_due` is greater than credit note `total`.
-   If the credit note `type` is `refundable`:
    -   The refundable credit note details are added to the `issued_credit_notes[]` attribute of the invoice.
    -   The invoice `status` does not change.
-   If the credit note `type` is `store`:
    -   The store credit note details are added to the `issued_credit_notes[]` attribute of the invoice.
    -   The invoice `status` does not change.

## Sample Credit note

```json
{
  "allocations": {},
  "amount_allocated": 0,
  "amount_available": 500,
  "amount_refunded": 0,
  "base_currency_code": "USD",
  "create_reason_code": "Product Unsatisfactory",
  "currency_code": "USD",
  "customer_id": "__test__KyVnHhSBWSy4m5e",
  "date": 1517501405,
  "deleted": false,
  "exchange_rate": 1,
  "exchange_rates": [
    {
      "currency_code": "EUR",
      "rate": 1.154
    },
    {..}
  ],
  "fractional_correction": 0,
  "id": "__demo_cn__1",
  "line_item_discounts": {},
  "line_item_taxes": {},
  "line_items": [
    {
      "amount": 500,
      "customer_id": "__test__KyVnHhSBWSy4m5e",
      "date_from": 1517501405,
      "date_to": 1517501405,
      "description": "Support Charge",
      "discount_amount": 0,
      "entity_type": "adhoc",
      "id": "li___test__KyVnHhSBWSyHE5r",
      "is_taxed": false,
      "item_level_discount_amount": 0,
      "object": "line_item",
      "pricing_model": "flat_fee",
      "quantity": 1,
      "tax_amount": 0,
      "tax_exempt_reason": "tax_not_configured",
      "unit_amount": 500
    },
    {..}
  ],
  "linked_refunds": {},
  "object": "credit_note",
  "price_type": "tax_exclusive",
  "reason_code": "product_unsatisfactory",
  "reference_invoice_id": "__demo_inv__1",
  "resource_version": 1517501405000,
  "round_off_amount": 0,
  "status": "refund_due",
  "sub_total": 500,
  "taxes": {},
  "total": 500,
  "type": "refundable",
  "updated_at": 1517501405
}
```

## Credit notes attributes

## Input Parameters

- `id` (required, string, max chars=50)
  Credit-note id.

- `customer_id` (required, string, max chars=50)
  The identifier of the customer this credit note belongs to.

- `subscription_id` (optional, string, max chars=50)
  The identifier of the subscription this Credit Note belongs to. **Note:** If _consolidated invoicing_ is enabled, to know the subscriptions attached with this Credit Note you have to refer [line\_item's](/docs/api/credit_notes/credit_note-object#line_items) _subscription\_id_. This attribute should **not** be used (which will be _null_ if this credit note has lines from multiple subscriptions).

- `reference_invoice_id` (optional, string, max chars=50)
  The identifier of the invoice against which this Credit Note is issued

- `type` (required, enumerated string)
  The credit note type. [Learn more](/docs/api/credit_notes/credit-note-object) about credit note types.
  Possible enum values:
    - `adjustment`
      Adjustment Credit Note
    - `refundable`
      Refundable Credit Note
    - `store`
      Store Credit Note

- `reason_code` (optional, enumerated string)
  The reason for issuing this credit note. The following reason codes are supported now\[Deprecated; use the [create\_reason\_code](/docs/api/credit_notes/credit_note-object#create_reason_code) parameter instead\]
  Possible enum values:
    - `write_off`
      This reason will be set automatically for the Credit Notes created during invoice [Write Off](https://www.chargebee.com/docs/invoice-operations.html#write-off) operation.
    - `subscription_change`
      This reason will be set automatically for Credit Notes created during Change Subscription operation when [proration](https://www.chargebee.com/docs/proration.html) is enabled
    - `subscription_cancellation`
      This reason will be set automatically for Credit Notes created during cancel subscription operation
    - `subscription_pause`
      This reason will be automatically set to credit notes created during pause/resume subscription operation.
    - `chargeback`
      Can be set when you are recording your customer Chargebacks
    - `product_unsatisfactory`
      Product Unsatisfactory
    - `service_unsatisfactory`
      Service Unsatisfactory
    - `order_change`
      Order Change
    - `order_cancellation`
      Order Cancellation
    - `waiver`
      Waiver
    - `other`
      Can be set when none of the above reason codes are applicable
    - `fraudulent`
      FRAUDULENT

- `status` (required, enumerated string)
  The credit note status.
  Possible enum values:
    - `adjusted`
      When the Credit Note has been adjusted against an invoice.
    - `refunded`
      When the entire credits (Credit Note amount) have been used (i.e either allocated to invoices or refunded).
    - `refund_due`
      When the credits are yet to be used, or have been partially used.
    - `voided`
      When the Credit Note has been cancelled.

- `vat_number` (optional, string, max chars=20)
  VAT number of the customer for whom this credit note is raised.

- `date` (optional, timestamp(UTC) in seconds)
  The date the credit note is issued.

- `price_type` (required, enumerated string, default=tax_exclusive)
  The price type of the credit note.
  Possible enum values:
    - `tax_exclusive`
      All amounts in the document are exclusive of tax.
    - `tax_inclusive`
      All amounts in the document are inclusive of tax.

- `currency_code` (required, string, max chars=3)
  The currency code (ISO 4217 format) for the credit note

- `total` (optional, in cents, default=0, min=0)
  Credit Note amount in cents.

- `amount_allocated` (optional, in cents, default=0, min=0)
  The amount allocated to invoices from the credit note.

- `amount_refunded` (optional, in cents, default=0, min=0)
  The refunds issued from this credit note.

- `amount_available` (optional, in cents, default=0, min=0)
  The yet to be used credits of this credit note.

- `refunded_at` (optional, timestamp(UTC) in seconds)
  The time this credit note gets fully used. Please note that this field is not present when partial refunds are issued.

- `voided_at` (optional, timestamp(UTC) in seconds)
  Timestamp indicating the date and time this credit note gets voided.

- `generated_at` (optional, timestamp(UTC) in seconds)
  The date/time when the credit note was raised. This date/time can be backdated, which means that the date/time can be earlier than the date/time the credit note was created.

- `resource_version` (optional, long)
  Version number of this resource. The `resource_version` is updated with a new timestamp in milliseconds for every change made to the resource. This attribute will be present only if the resource has been updated after 2016-09-28.

- `updated_at` (optional, timestamp(UTC) in seconds)
  Timestamp indicating when this credit note was last updated. This attribute will be present only if the resource has been updated after 2016-09-28.

- `channel` (optional, enumerated string)
  The subscription channel this object originated from and is maintained in.
  Possible enum values:
    - `web`
      The object was created (and is maintained) for the web channel directly in Chargebee via API or UI.
    - `app_store`
      The object data is synchronized with data from [in-app subscription(s)](/docs/api/in_app_subscriptions) created in Apple App Store. Direct manipulation of this object via UI or API is disallowed.
    - `play_store`
      The object data is synchronized with data from [in-app subscription(s)](/docs/api/in_app_subscriptions) created in Google Play Store. Direct manipulation of this object via UI or API is disallowed.
      
      In-App Subscriptions is currently in early access. Contact [eap@chargebee.com](mailto:eap@chargebee.com) for more information.

- `line_items_next_offset` (optional, string, max chars=1000)
  This attribute is returned only if additional resources are available. Use this value as the input parameter for `line_items_offset` to retrieve the next set of resources.
  
  **Note:**
  
  -   Applicable only when Enterprise-scale Invoicing is enabled.
  -   Enterprise-scale Invoicing is currently in **Private Beta**. Please reach out to [Chargebee Support](https://www.chargebee.com/docs/billing/2.0/kb/getting-started/how-to-contact-chargebees-support-team?utm_source=docs_api&utm_medium=content&utm_campaign=support) to enable this feature.

- `sub_total` (required, in cents, min=0)
  The Credit Note sub-total

- `sub_total_in_local_currency` (optional, in cents, min=0)
  Invoice subtotal in the currency of the place of supply.

- `total_in_local_currency` (optional, in cents, min=0)
  Total invoice amount in the currency of the place of supply.

- `local_currency_code` (optional, string, max chars=3)
  The currency code (ISO 4217 format) of the place of supply in which VAT needs to be converted and displayed.

- `round_off_amount` (optional, in cents, min=-99, max=99)
  Indicates the rounded-off amount. For example, if your invoice amount is $99.99, and the amount is rounded off to $100.00, in this case, $100.00 is your invoice amount, $0.01 is the `round_off_amount`. If there is no `round-off amount` , it will display `0` .

- `fractional_correction` (optional, in cents, min=-50000, max=50000)
  Indicates the fractional correction amount.

- `notes` (optional, string, max chars=3500)
  The list of notes attached to this credit note. Each note is displayed on customer-facing documents such as the [Credit Note PDF](/docs/api/credit_notes#retrieve_credit_note_as_pdf). Currently this list contains the note configured for the customer; additional note types may be added in future.

- `deleted` (required, boolean)
  Indicates that this resource has been deleted.

- `tax_category` (optional, string)
  Specifies the customer's category for the Goods and Services Tax (GST). This field is returned only if you've configured GST for the India region.

- `local_currency_exchange_rate` (optional, bigdecimal, min=1E-9, max=999999999.999999999)
  This parameter represents the exchange rate as a relative price of the base currency that appears as local currency in invoices and credit notes. The local currency exchange rate specifically refers to the exchange rate of a country's currency when converting it to another currency.
  
  For example, if you want to convert US dollars to euros, the local currency exchange rate would be the rate at which you can convert US dollars to euros.

- `create_reason_code` (optional, string, max chars=100)
  Reason code for creating the credit note. Must be one from a list of reason codes set in the Chargebee app in **Settings > Configure Chargebee > Reason Codes > Credit Notes > Create Credit Note**. Must be passed if set as mandatory in the app. The codes are case-sensitive

- `vat_number_prefix` (optional, string, max chars=10)
  An overridden value for the first two characters of the [full VAT number](https://en.wikipedia.org/wiki/VAT_identification_number). Only applicable specifically for customers with `[billing_address](/docs/api/customers/customer-object#billing_address)`
  
  `country` as `XI` (which is **United Kingdom - Northern Ireland** ).
  
  When you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or have [manually enabled](https://www.chargebee.com/docs/brexit.html#what-needs-to-be-done-in-chargebee) the Brexit configuration, you have the option of setting `[billing_address](/docs/api/customers/customer-object#billing_address)`
  
  `country` as `XI`. That's the code for **United Kingdom - Northern Ireland**. The first two characters of the VAT number in such a case is `XI` by default. However, if the VAT number was registered in UK, the value should be `GB`. Set `vat_number_prefix` to `GB` for such cases.

- `business_entity_id` (optional, string, max chars=50)
  The unique ID of the [business entity](/docs/api/advanced-features) of this credit\_note. This is always the same as the business entity of the invoice referred to by `[reference_invoice_id](/docs/api/credit_notes/credit_note-object#reference_invoice_id)`.

- `discounts` (optional, list of discount)
  The list of discounts applied to this credit note
  - `amount` (required, in cents, min=0)
    The amount deducted. The format of this value depends on the [kind of currency](/docs/api/currencies) .
  - `description` (optional, string, max chars=250)
    Description for this deduction.
  - `line_item_id` (optional, string, max chars=40)
    The unique id of the line item that this deduction is for. Is required when `discounts[entity_type]` is `item_level_coupon` or `document_level_coupon` .
  - `entity_type` (required, enumerated string)
    The type of deduction and the amount to which it is applied.
    Possible enum values:
      - `item_level_coupon`
        The deduction is due to a coupon applied to line item. The coupon `id` is passed as `entity_id` .
      - `document_level_coupon`
        The deduction is due to a coupon applied to the invoice `sub_total`. The coupon id is passed as `entity_id` .
      - `promotional_credits`
        The deduction is due to a [promotional credit](/docs/api/promotional_credits) applied to the invoice.
      - `prorated_credits`
        The deduction is due to a legacy adjustment credit applied to the invoice. The `entity_id` is `null` in this case. The legacy credits feature is superseded by `[adjustment_credit_notes](/docs/api/invoices/invoice-object#adjustment_credit_notes)` .
      - `item_level_discount`
        The deduction is due to a [discount](/docs/api/discounts) applied to a line item of the invoice. The discount `id` is available as the `entity_id`.
      - `document_level_discount`
        The deduction is due to a [discount](/docs/api/discounts) applied to the invoice `sub_total`. The discount `id` is available as the `entity_id`.
  - `discount_type` (optional, enumerated string)
    The type of discount that is applied to the line item. Relevant only when `discounts[entity_type]` is one of `item_level_discount` , `item_level_coupon` , `document_level_discount` , or `document_level_coupon`
    Possible enum values:
      - `fixed_amount`
        when amount is applied as discount
      - `percentage`
        when percentage is applied as discount
  - `entity_id` (optional, string, max chars=100)
    When the deduction is due to a `coupon` or a `[discount](/docs/api/discounts)` , then this is the `id` of the coupon or discount.
  - `coupon_set_code` (optional, string, max chars=50)
    The [coupon code](/docs/api/coupon_codes/coupon_code-object#code) , if applicable, used to provide the discount. The [coupon.id](/docs/api/coupons/coupon-object#id) is available in `entity_id` .

- `taxes` (optional, list of tax)
  The tax-lines of this credit note
  - `name` (required, string, max chars=100)
    The name of the tax applied. E.g. GST.
  - `amount` (required, in cents, min=0)
    The tax amount. This is set to the corresponding value on the invoice (`invoice.taxes[i].amount`), prorated by the ratio of `credit_note.total` to `invoice.total`.
  - `description` (optional, string, max chars=250)
    Description of the tax item.

- `tax_origin` (optional, tax_origin)
  contains information about the tax details which is applied on the invoice.
  - `country` (optional, string, max chars=50)
    The country code in ([ISO 3166-1 alpha-2 format](https://www.iso.org/iso-3166-country-codes.html) ) where the tax originated from.
  - `registration_number` (optional, string, max chars=100)
    It represents the tax registration number for the entity used to collect tax.

- `linked_refunds` (optional, list of credit_note_transaction)
  Payment Refunds issued from this credit note
  - `txn_id` (required, string, max chars=40)
    Uniquely identifies the transaction.
  - `applied_amount` (required, in cents, min=0)
    The transaction amount applied to this invoice
  - `applied_at` (required, timestamp(UTC) in seconds)
    Time when the transaction amount applied to this invoice.
  - `txn_status` (optional, enumerated string)
    The status of this transaction.
    Possible enum values:
      - `in_progress`
        Transaction is being processed by the gateway. This typically happens for [direct debit transactions](https://www.chargebee.com/docs/direct-debit-payments.html) or, in case of cards, refund transactions. Such transactions can take 2-7 days to complete, depending on the gateway and payment method.
      - `success`
        The transaction is successful.
      - `voided`
        The transaction got voided or authorization expired at gateway.
      - `failure`
        Transaction failed. Refer the 'error\_code' and 'error\_text' fields to know the reason for failure
      - `timeout`
        Transaction failed because of Gateway not accepting the connection.
      - `needs_attention`
        When connection with the Gateway gets terminated abruptly. For `needs_attention` status Chargebee automatically reconcile the transaction for few gateways, for rest of the gateways you have to use the [Reconcile transaction API](/docs/api/transactions/reconcile-transaction). You can use this API to update the `id_at_gateway` (Gateway Transaction ID) and `status` for a [`needs_attention`](/docs/api/transactions/transaction-object#status) transaction to be reconciled at par with the gateway.
        
        [Learn more](https://www.chargebee.com/docs/payments/2.0/needs-attention-transactions.html) about `needs_attention` transaction status
      - `late_failure`
        Indicates that a successful payment transaction has failed now due to a late failure notification from the payment gateway, typically caused by issues like insufficient funds or a closed bank account.
  - `txn_date` (optional, timestamp(UTC) in seconds)
    Indicates when this transaction occurred.
  - `txn_amount` (optional, in cents, min=0)
    Total amount of the transaction
  - `refund_reason_code` (optional, string, max chars=100)
    Reason code for the refund. Must be one from a list of reason codes set in the Chargebee app in **Settings > Configure Chargebee > Reason Codes > Credit Notes > Refund Credit Note**. Must be passed if set as mandatory in the app. The codes are case-sensitive

- `linked_tax_withheld_refunds` (optional, list of linked_tax_withheld_refund)
  The details of refunds recorded against the `[invoice.linked_taxes_withheld](/docs/api/invoices/invoice-object#linked_taxes_withheld)` component of the `invoice` [associated](/docs/api/credit_notes/credit_note-object#reference_invoice_id) with this `credit_note`.
  - `id` (required, string, max chars=40)
    An auto-generated unique identifier for the tax withheld. The value starts with the prefix `tax_wh_`. For example, `tax_wh_16BdDXSlbu4uV1Ee6` .
  - `amount` (optional, in cents, min=1)
    The amount withheld by the customer as tax from the invoice. The unit depends on the [type of currency](/docs/api/getting-started) .
  - `description` (optional, string, max chars=65k)
    The description for this tax withheld.
  - `date` (optional, timestamp(UTC) in seconds)
    Date or time associated with the tax withheld.
  - `reference_number` (optional, string, max chars=100)
    A unique external reference number for the tax withheld. Typically, this is the reference number used by the system you are integrating the API with. Depending on your integration, this could be the reference number issued by the taxation authority to identify the customer or the specific tax transaction.

- `allocations` (optional, list of applied_credit)
  Invoice allocations made from this credit note.
  - `invoice_id` (required, string, max chars=50)
    Unique identifier of the invoice.
  - `allocated_amount` (required, in cents, min=0)
    Amount of this refund transaction.
  - `allocated_at` (required, timestamp(UTC) in seconds)
    Indicates when this refund occured.
  - `invoice_date` (optional, timestamp(UTC) in seconds)
    Closing date of the invoice. Typically this is the date on which invoice is generated
  - `invoice_status` (required, enumerated string)
    Current status of the invoice.
    Possible enum values:
      - `paid`
        Indicates a paid invoice.
      - `posted`
        Indicates the payment is not yet collected and will be in this state till the due date to indicate the due period
      - `payment_due`
        Indicates the payment is not yet collected and is being retried as per retry settings.
      - `not_paid`
        Indicates the payment is not made and all attempts to collect is failed.
      - `voided`
        Indicates a voided invoice.
      - `pending`
        The [invoice](/docs/api/invoices/invoice-object#status) is yet to be closed (sent for payment collection). An invoice is generated with this `status` when it has line items that belong to items that are `metered` or when the `subscription.create_pending_invoices`attribute is set to `true`. The [invoice](/docs/api/v2/pcv-1/invoices/invoice-object#status) is yet to be closed (sent for payment collection). All invoices are generated with this `status` when [Metered Billing](https://www.chargebee.com/docs/1.0/metered_billing.html) is enabled for the site.
  - `tax_application` (optional, enumerated string)
    Specifies how tax is handled for invoice allocations made from this credit note.
    Possible enum values:
      - `pre_tax`
        Allocations are applied before tax calculation.
      - `post_tax`
        Allocations are applied after tax calculation.

- `exchange_rates` (optional, list of exchange_rate)
  List of exchange rates applied when converting credit note amounts to other currencies (such as VAT local currency and organization local currency). Each entry contains [`currency_code`](/docs/api/credit_notes/credit_note-object#exchange_rates_currency_code) and [`rate`](/docs/api/credit_notes/credit_note-object#exchange_rates_rate).
  
  The credit note currency is the base currency. When multiple rates target the same currency, only one entry is returned.
  
  This array is different from `exchange_rate` in the response. An entry whose `currency_code` matches [`local_currency_code`](/docs/api/credit_notes/credit_note-object#local_currency_code) uses the same rate as [`local_currency_exchange_rate`](/docs/api/credit_notes/credit_note-object#local_currency_exchange_rate).
  
  This array is returned in the response only when the corresponding features are enabled.
  - `currency_code` (required, string, max chars=3)
    Target currency for the conversion (ISO 4217). The credit note currency is the base currency.
  - `rate` (required, bigdecimal, min=1E-9, max=999999999.999999999)
    Exchange rate applied as: 1 `currency_code` = `rate` credit note currency.
    
    For example, when the credit note currency is `USD`, `currency_code` is `INR`, and `rate` is `0.010448403`, then 1 INR = 0.010448403 USD.

- `shipping_address` (optional, shipping_address)
  Shipping address for the credit note.
  - `first_name` (optional, string, max chars=150)
    The first name of the contact.
  - `last_name` (optional, string, max chars=150)
    The last name of the contact.
  - `email` (optional, string, max chars=70)
    The email address.
  - `company` (optional, string, max chars=250)
    The company name.
  - `phone` (optional, string, max chars=50)
    The phone number.
  - `line1` (optional, string, max chars=150)
    Address line 1
  - `line2` (optional, string, max chars=150)
    Address line 2
  - `line3` (optional, string, max chars=150)
    Address line 3
  - `city` (optional, string, max chars=50)
    The name of the city.
  - `state_code` (optional, string, max chars=50)
    The [ISO 3166-2 state/province code](https://www.iso.org/obp/ui/#search) without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set `state_code` as `AZ` (not `US-AZ` ). For Tamil Nadu (India), set as `TN` (not `IN-TN` ). For British Columbia (Canada), set as `BC` (not `CA-BC` ).
  - `state` (optional, string, max chars=50)
    The state/province name.
  - `country` (optional, string, max chars=50)
    The billing address country of the customer. Must be one of [ISO 3166 alpha-2 country code](https://www.iso.org/iso-3166-country-codes.html) .
    
    **Note**: If you enter an invalid country code, the system will return an error.
    
    **Brexit**
    
    If you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or later, or have [manually enable](https://www.chargebee.com/docs/brexit.html#what-needs-to-be-done-in-chargebee) the Brexit configuration, then `XI` (the code for **United Kingdom - Northern Ireland**) is available as an option.
  - `zip` (optional, string, max chars=20)
    Zip or postal code. The number of characters is validated according to the rules [specified here](https://i18napis.appspot.com/address) .
  - `validation_status` (optional, enumerated string, default=not_validated)
    The address verification status.
    Possible enum values:
      - `not_validated`
        Address is not yet validated.
      - `valid`
        Address was validated successfully.
      - `partially_valid`
        The address is valid for taxability but has not been validated for shipping.
      - `invalid`
        Address is invalid.

- `billing_address` (optional, billing_address)
  Billing address for the credit note.
  - `first_name` (optional, string, max chars=150)
    The first name of the billing contact.
  - `last_name` (optional, string, max chars=150)
    The last name of the billing contact.
  - `email` (optional, string, max chars=70)
    The email address.
  - `company` (optional, string, max chars=250)
    The company name.
  - `phone` (optional, string, max chars=50)
    The phone number.
  - `line1` (optional, string, max chars=150)
    Address line 1
  - `line2` (optional, string, max chars=150)
    Address line 2
  - `line3` (optional, string, max chars=150)
    Address line 3
  - `city` (optional, string, max chars=50)
    The name of the city.
  - `state_code` (optional, string, max chars=50)
    The [ISO 3166-2 state/province code](https://www.iso.org/obp/ui/#search) without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set `state_code` as `AZ` (not `US-AZ` ). For Tamil Nadu (India), set as `TN` (not `IN-TN` ). For British Columbia (Canada), set as `BC` (not `CA-BC` ).
  - `state` (optional, string, max chars=50)
    State or Province
  - `country` (optional, string, max chars=50)
    The billing address country of the customer. Must be one of [ISO 3166 alpha-2 country code](https://www.iso.org/iso-3166-country-codes.html) .
    
    **Note**: If you enter an invalid country code, the system will return an error.
    
    **Brexit**
    
    If you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or later, or have [manually enable](https://www.chargebee.com/docs/brexit.html#what-needs-to-be-done-in-chargebee) the Brexit configuration, then `XI` (the code for **United Kingdom - Northern Ireland**) is available as an option.
  - `zip` (optional, string, max chars=20)
    Zip or postal code. The number of characters is validated according to the rules [specified here](https://i18napis.appspot.com/address) .
  - `validation_status` (optional, enumerated string, default=not_validated)
    The address verification status.
    Possible enum values:
      - `not_validated`
        Address is not yet validated.
      - `valid`
        Address was validated successfully.
      - `partially_valid`
        The address is valid for taxability but has not been validated for shipping.
      - `invalid`
        Address is invalid.

- `einvoice` (optional, einvoice)
  An e-invoice or electronic invoice is a structured representation of an invoice that is interoperable between computerized invoicing systems. Depending on the country, e-invoicing can be necessary to meet financial/taxation authority regulations.
  - `id` (required, string, max chars=50)
    The unique `id` for the e-invoice. This is auto-generated by Chargebee.
  - `reference_id` (optional, string, max chars=50)
    Identifier returned by the connected e-invoicing provider for this submission (for example, a document submission id). Chargebee uses this value when communicating with the provider to retrieve submission status and related artifacts.
  - `reference_number` (optional, string, max chars=100)
    This attribute is used to populate the unique reference number assigned to an invoice on the Invoice Registration Portal (IRP) network. It is essential for identifying and tracking invoices that are processed through the IRP network.
    
    In the future, this field may be used to store similar reference numbers for other networks.
  - `status` (required, enumerated string)
    The status of processing the e-invoice. To obtain detailed information about the current `status` , see `message` .
    Possible enum values:
      - `scheduled`
        Sending the e-invoice to the customer has been scheduled.
      - `skipped`
        The e-invoice was not sent. This could be due to missing information or because the `entity_identifier` is not registered on the e-invoicing network.
      - `in_progress`
        The e-invoice has been sent and Chargebee is waiting for confirmation from the receiving entity.
      - `success`
        The e-invoice has been successfully delivered to the customer.
      - `failed`
        The e-invoice was sent and there was an error due to which it was not delivered.
      - `registered`
        The e-invoice was sent and there was an error due to which it was not delivered but got cleared in the IRP.
      - `accepted`
        The e-invoice was sent and it was accepted by the receiving entity. The sending entity shall also accept the e-invoice.
      - `rejected`
        The e-invoice was sent and it was rejected by the receiving entity due to some reason. The sending entity shall also reject the e-invoice.
      - `message_acknowledgement`
        An acknowledgment confirming that the application response was successfully received by the receiving entity.
      - `in_process`
        The e-invoice is currently being processed by the receiving entity.
      - `under_query`
        The receiving entity has raised a query regarding the e-invoice. Additional information or clarification is required before proceeding.
      - `conditionally_accepted`
        The e-invoice has been accepted with conditions.
      - `paid`
        The receiving entity has confirmed that the e-invoice has been paid.
  - `message` (optional, string, max chars=3000)
    Detailed information about the status of the e-invoice. When `status` is `skipped` or `failed` , this contains the reason or error details. The following are some valid examples:
    
    -   Invoice successfully sent to customer via the e-invoicing network 9090:123456
    -   Invoice successfully sent to customer via email id abc@acme.com
  - `provider_references` (optional)
    List of key-value pairs from the e-invoicing provider (e.g. Receipt Message ID).

- `site_details_at_creation` (optional, site_details_at_creation)
  It contains site-specific information, including timezone and organisational address.
  - `timezone` (optional, string, max chars=50)
    It represents the timezone of the site at the time of entity creation.
  - `organization_address` (optional, jsonobject)
    It represents the address configured for the site during entity creation. Includes `currency_code` (ISO 4217): the currency of the organisation address country at creation time.

