POST /credit_notes
Creates a credit_note
for the specified invoice.
Note:
If the credit_note
type is refundable
, then linked_taxes_withheld.amount
for the invoice specified can also be included in the 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 Possible 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 Possible 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-event-email |
String | No |
skip only emails Possible values:
|
Request body fields
Name | Type | Required | Description |
---|---|---|---|
customer_id |
String | No | |
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. |
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 Possible values:
|
currency_code |
String | No | |
type |
String | Yes |
The credit note type. Learn more about credit note types. * refundable - Refundable Credit Note * store - Store Credit Note * adjustment - Adjustment Credit Note Possible 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 the Credit Note is issued. |
total |
Integer | No |
Credit Note amount in cents. You can either pass the total parameter or the line_items parameter. Passing both will result in an error. Default value: 0 |
create_reason_code |
String | No |
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. |
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.