POST /credit_notes

Creates a credit note for the specified invoice.

Impacts

Invoice

See Impact on reference invoice.

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.

Servers

Request headers

Name Type Required Description
chargebee-request-origin-device String No

The device from which the customer has made the request

Content-Type String Yes The media type of the request body.

Default value: "application/x-www-form-urlencoded"

chargebee-event-webhook String No

skip only webhooks

Valid values:

  • "all-disabled"
chargebee-business-entity-id String No

If the site has multiple business entities, you can use this custom HTTP header to specify the business entity for which Chargebee should perform the operation.

chargebee-event-actions String No

skip all actions to be done on the events

Valid values:

  • "all-disabled"
chargebee-request-origin-user String No

The email address of your customer/user. Use this when the email address has only ASCII characters.

chargebee-request-origin-ip String No

The IP address of the customer where the request originated

chargebee-request-origin-user-encoded String No

The Base64-encoded email address of your customer/user. Use this if the email address has UTF-8 characters. When this header is provided, the header chargebee-request-origin-user is ignored.

chargebee-event-email String No

skip only emails

Valid values:

  • "all-disabled"

Request body fields

Name Type Required Description
customer_id String No

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

Required when

  • type is refundable and reference_invoice_id is not provided. This creates a standalone credit note.
comment String No

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 .

reference_invoice_id String No

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.

line_items Object No

Parameters for line_items

line_items.unit_amount[] Array No

Unit amount of the line item. Required for FLAT_FEE, PER_UNIT and VOLUME pricing model.

line_items.date_from[] Array No

Start date of this line item.

line_items.description[] Array No

Description for the line item.

line_items.date_to[] Array No

End date of this line item.

line_items.amount[] Array No

Amount of the line item. Applicable only for STAIRSTEP, TIERED pricing_model.

line_items.entity_id[] Array No
line_items.quantity[] Array No

Quantity of the line item. Required for PER_UNIT and VOLUME pricing model.

line_items.quantity_in_decimal[] Array No

The decimal representation of the quantity of the line_item. Applicable for the line_item when the pricing_model is per_unit and volume. Can be provided only when multi-decimal pricing is enabled.

line_items.reference_line_item_id[] Array No

Uniquely identifies a line_item

line_items.unit_amount_in_decimal[] Array No

The decimal representation of the unit amount of the line_item. The value is in major units of the currency. Applicable for the line_item when the pricing_model is flat_fee , per_unit or volume. Can be provided only when multi-decimal pricing is enabled.

line_items.entity_type[] Array No
reason_code String No

The reason for issuing this Credit Note. The following reason codes are supported now[Deprecated; use the create_reason_code parameter instead]. * chargeback -

Can be set when you are recording your customer Chargebacks * subscription_change -

This reason will be set automatically for Credit Notes created during Change Subscription operation when proration is enabled * waiver -

Waiver * order_cancellation -

Order Cancellation * order_change -

Order Change * product_unsatisfactory -

Product Unsatisfactory * subscription_pause -

This reason will be automatically set to credit notes created during pause/resume subscription operation. * service_unsatisfactory -

Service Unsatisfactory * other -

Can be set when none of the above reason codes are applicable * subscription_cancellation -

This reason will be set automatically for Credit Notes created during cancel subscription operation * write_off -

This reason will be set automatically for the Credit Notes created during invoice Write Off operation. * fraudulent -

FRAUDULENT

Valid values:

  • "service_unsatisfactory"
  • "other"
  • "product_unsatisfactory"
  • "order_change"
  • "order_cancellation"
  • "waiver"
currency_code String No
type String Yes

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.
* 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.
* adjustment -

Creates an adjustment credit note.

Prerequisites

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

Valid values:

  • "refundable"
  • "store"
  • "adjustment"
customer_notes String No

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 .

date Integer No

The date on which the credit note is issued.

Constraints

  • Must be on or after the invoice.date and cannot be a future date.
total Integer No

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.

Default value: 0

create_reason_code String No

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.

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.