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
typeis created. - If the credit note
typeisadjustment:totalandamount_allocatedare set to the adjusted amount.statusis set toadjusted.
- If the credit note
typeisrefundableorstore:totalandamount_availableare set to the refundable amount.statusis set torefund_due.
- The
taxes[].amountandline_item_taxes[].tax_amountare set to the corresponding values on the invoice, prorated by the ratio ofcredit_note.totaltoinvoice.total.
Servers
- {protocol}://{site}.{environment}:{port}/api/v2
- {protocol}://{site}-test.{environment}:{port}/api/v2
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:
|
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:
|
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:
|
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
|
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
Note
When not provided and |
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_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_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:
|
currency_code |
String | No | |
type |
String | Yes |
The type of credit note to create. Prerequisites
Creates a refundable credit note. Prerequisites
Creates a store credit note. Prerequisites
Creates an adjustment credit note. Prerequisites
Valid values:
|
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
|
total |
Integer | No |
The total credit note amount. Constraints
Default value: 0 |
create_reason_code |
String | No |
Reason code for creating the credit note.
|
How to start integrating
- Add HTTP Task to your workflow definition.
- 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.
- Click Test request to test run your request to the API and see the API's response.