POST /credit_notes/import_credit_note
Use this api to import credit notes into your Chargebee site. Billing address, Shipping Address, Vat number will be copied from the reference invoice.
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 |
---|---|---|---|
discounts |
Object | No |
Parameters for discounts |
discounts.description[] |
Array | No |
Description for this deduction. |
discounts.entity_id[] |
Array | No |
When the deduction is due to a |
discounts.amount[] |
Array | Yes |
The amount deducted. The format of this value depends on the kind of currency. |
discounts.line_item_id[] |
Array | No |
The unique id of the line item that this deduction is for. Is required when |
discounts.entity_type[] |
Array | Yes | |
reference_invoice_id |
String | Yes |
The identifier of the invoice against which this Credit Note is issued. |
currency_code |
String | No |
The currency code (ISO 4217 format) for the credit note. |
sub_total |
Integer | No |
The Credit Note sub-total. |
status |
String | No |
The credit note status. * refund_due - When the credits are yet to be used, or have been partially used. * refunded - When the entire credits (Credit Note amount) have been used (i.e either allocated to invoices or refunded). * voided - When the Credit Note has been cancelled. * adjusted - When the Credit Note has been adjusted against an invoice. Possible values:
|
voided_at |
Integer | No |
Timestamp indicating the date and time this Credit Note gets voided. |
date |
Integer | Yes |
The date the Credit Note is issued. |
round_off_amount |
Integer | No |
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 |
create_reason_code |
String | Yes |
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. |
total |
Integer | No |
Credit Note amount in cents. Default value: 0 |
allocations |
Object | No |
Parameters for allocations |
allocations.allocated_at[] |
Array | Yes |
Time when the allocation was occurred |
allocations.invoice_id[] |
Array | Yes |
The unique invoice ID for the allocation |
allocations.allocated_amount[] |
Array | Yes |
The allocated amount for the credit note |
id |
String | Yes |
Credit Note Number. |
customer_id |
String | No |
This identifies the customer for whom the credit note needs to be created. |
line_items |
Object | No |
Parameters for line_items |
line_items.tax3_name[] |
Array | No |
Third tax name |
line_items.tax9_name[] |
Array | No |
Ninth tax name |
line_items.description[] |
Array | Yes |
Description for this line item |
line_items.tax6_name[] |
Array | No |
Sixth tax name |
line_items.tax2_amount[] |
Array | No |
Second tax amount |
line_items.item_level_discount1_amount[] |
Array | No |
First item level discount amount |
line_items.tax1_amount[] |
Array | No |
First tax amount |
line_items.tax3_amount[] |
Array | No |
Third tax amount |
line_items.unit_amount_in_decimal[] |
Array | No |
The decimal representation of the unit amount of the |
line_items.item_level_discount2_amount[] |
Array | No |
Second item level discount amount |
line_items.id[] |
Array | No |
Uniquely identifies a line_item |
line_items.tax4_amount[] |
Array | No |
Fourth tax amount |
line_items.tax5_amount[] |
Array | No |
Fifth tax amount |
line_items.tax6_amount[] |
Array | No |
Sixth tax amount |
line_items.tax7_amount[] |
Array | No |
Seventh tax amount |
line_items.amount_in_decimal[] |
Array | No |
The decimal representation of the amount for the |
line_items.tax2_name[] |
Array | No |
Second tax name |
line_items.reference_line_item_id[] |
Array | No |
Uniquely identifies a line_item of invoice for which this reversal represents. |
line_items.item_level_discount2_entity_id[] |
Array | No |
Second item level discount entity id |
line_items.subscription_id[] |
Array | No |
A unique identifier for the subscription this line item belongs to. |
line_items.date_to[] |
Array | No |
End date of this line item. |
line_items.quantity[] |
Array | No |
Quantity of the recurring item which is represented by this line item. For |
line_items.quantity_in_decimal[] |
Array | No |
The decimal representation of the quantity of this line_item. Returned when the |
line_items.tax9_amount[] |
Array | No |
Ninth tax amount |
line_items.tax5_name[] |
Array | No |
Fifth tax name |
line_items.tax8_amount[] |
Array | No |
Eighth tax amount |
line_items.tax10_amount[] |
Array | No |
Tenth tax amount |
line_items.entity_type[] |
Array | No | |
line_items.tax8_name[] |
Array | No |
Eighth tax name |
line_items.unit_amount[] |
Array | No |
Unit amount of the line item. |
line_items.tax1_name[] |
Array | No |
First tax name |
line_items.item_level_discount1_entity_id[] |
Array | No |
First item level discount entity id |
line_items.date_from[] |
Array | No |
Start date of this line item. |
line_items.amount[] |
Array | No |
Total amount of this lineitem. Not required if the line_items[unit_amount] param is passed |
line_items.entity_id[] |
Array | No |
The identifier of the modelled entity this line item is based on. Will be null for 'adhoc' entity type |
line_items.tax7_name[] |
Array | No |
Seventh tax name |
line_items.tax4_name[] |
Array | No |
Fourth tax name |
line_items.tax10_name[] |
Array | No |
Tenth tax name |
fractional_correction |
Integer | No |
Indicates the fractional correction amount. |
vat_number_prefix |
String | No |
An overridden value for the first two characters of the full VAT
number. Only applicable specifically for customers with billing_address When you have enabled EU VAT in 2021 or have manually
enabled the Brexit configuration, you have the option of setting billing_address |
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:
|
linked_refunds |
Object | No |
Parameters for linked_refunds |
linked_refunds.reference_number[] |
Array | No |
Reference number for this refund. |
linked_refunds.amount[] |
Array | Yes |
Amount of this refund transaction. |
linked_refunds.payment_method[] |
Array | Yes | |
linked_refunds.date[] |
Array | Yes |
The date of refund. |
line_item_tiers |
Object | No |
Parameters for line_item_tiers |
line_item_tiers.unit_amount[] |
Array | No |
The price of the tier if the charge model is a |
line_item_tiers.starting_unit_in_decimal[] |
Array | No |
The decimal representation of the lowest value of quantity in this tier. This is zero for the lowest tier. For all other tiers, it is the same as |
line_item_tiers.ending_unit[] |
Array | No |
The upper limit of a range of units for the tier |
line_item_tiers.quantity_used_in_decimal[] |
Array | No |
The decimal representation of the quantity purchased from this tier. Returned when the |
line_item_tiers.line_item_id[] |
Array | Yes |
Uniquely identifies a line_item |
line_item_tiers.starting_unit[] |
Array | No |
The lower limit of a range of units for the tier |
line_item_tiers.ending_unit_in_decimal[] |
Array | No |
The decimal representation of the highest value of quantity in this tier. This attribute is not applicable for the highest tier. For all other tiers, it must be equal to the |
line_item_tiers.unit_amount_in_decimal[] |
Array | No |
The decimal representation of the per-unit price for the tier when the |
line_item_tiers.quantity_used[] |
Array | No |
The number of units purchased in a range. |
taxes |
Object | No |
Parameters for taxes |
taxes.rate[] |
Array | Yes |
The rate of tax used to calculate tax amount |
taxes.juris_name[] |
Array | No |
The name of the tax jurisdiction |
taxes.name[] |
Array | Yes |
The name of the tax applied |
taxes.description[] |
Array | No |
Description of tax |
taxes.amount[] |
Array | No |
Total tax amount charged for this invoice |
taxes.juris_code[] |
Array | No |
The tax jurisdiction code |
taxes.juris_type[] |
Array | No | |
subscription_id |
String | No |
The identifier of the subscription for which this credit note needs to be created. |
refunded_at |
Integer | No |
The time this Credit Note gets fully used. Please note that this field is not present when partial refunds are issued. |
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.