Introducing the Better Auth Chargebee plugin: Use it to handle subscriptions, billing, and auth seamlessly.Try now
ChargebeechargebeeAPI

Create credit note

Idempotency Supported

Creates a credit note for the specified invoice.

Impacts

Credit note

  • A new credit note of the specified type is created.
  • If the credit note type is adjustment:
    • total and amount_allocated are set to the adjusted amount.
    • status is set to adjusted.
  • If the credit note type is refundable or store:
    • total and amount_available are set to the refundable amount.
    • status is set to refund_due.
  • The taxes[].amount and line_item_taxes[].tax_amount are set to the corresponding values on the invoice, prorated by the ratio of credit_note.total to invoice.total.

Sample Request

Sample Result[JSON]

URL Format

POST https://[site].chargebee.com/api/v2/credit_notes

Input Parameters

reference_invoice_id
optional, string, max chars=50

The identifier of the invoice against which this credit note is issued.

Required when

  • type is adjustment or store.

Note When not provided and type is refundable, then customer_id must be provided because this creates a standalone credit note.

customer_id
optional, string, max chars=50

The identifier of the customer for whom this credit note is issued.

Required when

total
optional, in cents, default=0, min=0

The total credit note amount.

Constraints

  • Pass either the total or line_items parameter.
  • If type is adjustment, total must not exceed the amount due on the invoice minus the total amount of any transactions in progress for the invoice. Calculate this as invoice.amount_due minus the sum of invoice.linked_payments[i].amount where invoice.linked_payments[i].txn_status is in_progress.
  • If type is refundable or store:
    • If reference_invoice_id is provided, total must not exceed the refundable amount on the invoice. Calculate the refundable amount as the sum of:
      • Sum of linked_payments[i].amount where linked_payments[i].txn_status is success
      • Sum of applied_credits[i].applied_amount where applied_credits[i].status is not voided
      • Sum of linked_taxes_withheld[].amount
      • Minus the sum of issued_credit_notes[i].cn_total where issued_credit_notes[i].status is not voided
    • If reference_invoice_id is not provided, there is no limit on the total because this creates a standalone credit note.
type
required, enumerated string

The type of credit note to create.

Prerequisites

  • If type is adjustment, the invoice.status must be payment_due, posted or not_paid.
  • If type is refundable or store, the invoice.status must be paid, payment_due, posted, or not_paid.
Enum Values
adjustment

Creates an adjustment credit note.

Prerequisites

  • The invoice.status must be payment_due, posted or not_paid.
refundable

Creates a refundable credit note.

Prerequisites

  • The invoice.status must be paid, payment_due, posted, or not_paid.
store

Creates a store credit note.

Prerequisites

  • The invoice.status must be paid, payment_due, posted, or not_paid.
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 parameter instead].

Enum Values
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

create_reason_code
optional, string, max chars=100

Reason code for creating the credit note.

Constraints

  • Must be one of the case-sensitive reason codes set in Chargebee Billing.

Required when

  • Reason codes are configured as mandatory on the site.
date
optional, timestamp(UTC) in seconds

The date on which the credit note is issued.

Constraints

  • Must be on or after the invoice.date and cannot be a future date.
customer_notes
optional, string, max chars=2000

A note to be added for this operation, to the credit note. This note is displayed on customer-facing documents such as the Credit Note PDF .

currency_code
required if Multicurrency is enabled, string, max chars=3
comment
optional, string, max chars=300

An internal comment to be added for this operation, to the credit note. This comment is displayed on the Chargebee UI. It is not displayed on any customer-facing Hosted Page or any document such as the Credit Note PDF .

line_items[0..n]
Parameters for line_items. Multiple line_items can be passed by specifying unique indices.
pass parameters as line_items[<param name>][<idx:0..n>]

Returns

Credit note object
Resource object representing credit_note
Invoice object
Resource object representing invoice