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

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:

  • "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

Possible 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

Possible values:

  • "all-disabled"

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 coupon, then this is the id of the coupon. Is required when discounts[entity_type] is item_level_coupon or document_level_coupon.

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] is item_level_coupon or document_level_coupon.

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:

  • "refund_due"
  • "adjusted"
  • "refunded"
  • "voided"
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 round_off_amount. If there is no round-off amount, it will display 0.

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_item. The value is in major units of the currency. Returned when the line_item is quantity-based and multi-decimal pricing is enabled.

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_item, in major units of the currency. Typically equals to unit_amount_in_decimal x quantity_in_decimal. Returned when multi-decimal pricing is enabled.

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 metered line items, this value is updated from usages once when the invoice is generated as pending and finally when the invoice is closed.
Quantity of the recurring item which is represented by this line item.

line_items.quantity_in_decimal[] Array No

The decimal representation of the quantity of this line_item. Returned when the line_item is quantity-based and multi-decimal pricing is enabled.

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 country as XI (which is United Kingdom - Northern Ireland ).

When you have enabled EU VAT in 2021 or have manually enabled the Brexit configuration, you have the option of setting billing_address country as XI. That's the code for United Kingdom - Northern Ireland . The first two characters of the VAT number in such a case is XI by default. However, if the VAT number was registered in UK, the value should be GB. Set vat_number_prefix to GB for such cases.

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:

  • "refundable"
  • "store"
  • "adjustment"
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 stairtstep pricing , or the price of each unit in the tier if the charge model is tiered/volume pricing.

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 ending_unit_in_decimal of the next lower tier. Returned only when the line_items.pricing_model is tiered, volume or stairstep and multi-decimal pricing is enabled.

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 is quantity-based and multi-decimal pricing is enabled.

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 starting_unit_in_decimal of the next higher tier. Returned only when the line_items.pricing_model is tiered, volume or stairstep and multi-decimal pricing is enabled.

line_item_tiers.unit_amount_in_decimal[] Array No

The decimal representation of the per-unit price for the tier when the pricing_model is tiered or volume. When the pricing_model is stairstep, it is the decimal representation of the total price for line_item. The value is in major units of the currency. Returned when the line_item is quantity-based and multi-decimal pricing is enabled.

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

  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.