younifyd
Menu

Import Unbilled Charges

Import unbilled charges

POST/subscriptions/{subscription-id}/import_unbilled_charges

Use it in a workflow

  1. Add a step and choose the Chargebee connector.
  2. Pick the Import Unbilled Charges action (under Chargebee API).
  3. Fill in the fields below, then reference the result from later steps as {{importUnbilledCharges.response.data}}.

Request

Path parameters

subscription-idstringrequired

Headers

chargebee-request-origin-devicestring

The device from which the customer has made the request

chargebee-request-origin-userstring (email)

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

chargebee-request-origin-user-encodedstring (email)

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-request-origin-ipstring

The IP address of the customer where the request originated

chargebee-event-actionsstring

skip all actions to be done on the events

One ofall-disabled

chargebee-event-emailstring

skip only emails

One ofall-disabled

chargebee-event-webhookstring

skip only webhooks

One ofall-disabled

chargebee-business-entity-idstring

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.

Request body

Enter the body as JSON in the step's Body field.

unbilled_chargesobject

Parameters for unbilled_charges

idarray<string>

Uniquely identifies an unbilled charge.

date_fromarray<integer (unix-time)>required

Start date of this charge.

date_toarray<integer (unix-time)>required

End date of this charge.

entity_typearray<string>required
entity_idarray<string>

The identifier of the modelled entity this charge is based on. Will be null for 'adhoc' entity type.

descriptionarray<string>

Detailed description about this charge.

unit_amountarray<integer (int64)>

Unit amount of the charge item.

quantityarray<integer (int32)>

Quantity of the item which is represented by this charge.

amountarray<integer (int64)>

Total amount of this charge. Typically equals to unit amount x quantity.

unit_amount_in_decimalarray<string>

<p class="mb-2">The decimal representation of the amount for the charge, in major units of the currency. Typically equals to <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">unit_amount_in_decimal</code> x <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">quantity_in_decimal</code>. Returned when <a href="/docs/api/currencies" target="_blank">multi-decimal pricing</a> is enabled.</p>

quantity_in_decimalarray<string>

The decimal representation of the quantity of this entity. Returned when the entity is quantity-based and [multi-decimal pricing](/docs/api/currencies) is enabled.

amount_in_decimalarray<string>

The decimal representation of the unit amount for the entity. The value is in major units of the currency. Returned when the entity is quantity-based and [multi-decimal pricing](/docs/api/currencies) is enabled.

discount_amountarray<integer (int64)>

Total discounts for this charge.

use_for_prorationarray<boolean>

If the unbilled charge falls within the subscription's current term it will be used for proration.

is_advance_chargearray<boolean>

The value of this parameter will be true if it is a recurring unbilled charge for a future term.

discountsobject

Parameters for discounts

unbilled_charge_idarray<string>

Uniquely identifies an unbilled charge.

entity_typearray<string>
entity_idarray<string>

<p class="mb-2">When the deduction is due to a <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">coupon</code> , then this is the <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">id</code> of the coupon. Is required when <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">discounts[entity_type]</code> is <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">item_level_coupon</code> or <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">document_level_coupon</code> .</p>

descriptionarray<string>

Description for this deduction.

amountarray<integer (int64)>required

The amount deducted. The format of this value depends on the [kind of currency](/docs/api/currencies) .

tiersobject

Parameters for tiers

unbilled_charge_idarray<string>required

Uniquely identifies an unbilled charge.

starting_unitarray<integer (int32)>

The lower limit of a range of units for the tier

ending_unitarray<integer (int32)>

The upper limit of a range of units for the tier

quantity_usedarray<integer (int32)>

The number of units purchased in a range.

unit_amountarray<integer (int64)>

<p class="mb-2">The price of the tier if the charge model is a <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">stairtstep</code> pricing , or the price of each unit in the tier if the charge model is <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">tiered</code> /<code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">volume</code> pricing.</p>

starting_unit_in_decimalarray<string>

<p class="mb-2">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 <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">ending_unit_in_decimal</code> of the next lower tier. Returned only when the <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">line_items.pricing_model</code> is <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">tiered</code> , <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">volume</code> or <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">stairstep</code> and <a href="/docs/api/currencies" target="_blank">multi-decimal pricing</a> is enabled.</p>

ending_unit_in_decimalarray<string>

<p class="mb-2">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 <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">starting_unit_in_decimal</code> of the next higher tier. Returned only when the <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">line_items.pricing_model</code> is <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">tiered</code> , <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">volume</code> or stairstep and <a href="/docs/api/currencies" target="_blank">multi-decimal pricing</a> is enabled.</p>

quantity_used_in_decimalarray<string>

<p class="mb-2">The decimal representation of the quantity purchased from this tier. Returned when the <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">line_item</code> is quantity-based and <a href="/docs/api/currencies" target="_blank">multi-decimal pricing</a> is enabled.</p>

unit_amount_in_decimalarray<string>

<p class="mb-2">The decimal representation of the per-unit price for the tier when the <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">pricing_model</code> is <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">tiered</code> or <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">volume</code>. When the <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">pricing_model</code> is <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">stairstep</code> , it is the decimal representation of the total price for <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">line_item</code>. The value is in major units of the currency. Returned when the <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">line_item</code> is quantity-based and <a href="/docs/api/currencies" target="_blank">multi-decimal pricing</a> is enabled.</p>

json
{
  "unbilled_charges": null,
  "discounts": null,
  "tiers": null
}

Response

Returns 200 with an object. Read it in later steps with {{importUnbilledCharges.response.data.<field>}}.

unbilled_chargesarray<object>

<p class="mb-2">Resource object representing unbilled_charge</p>

idstring

Uniquely identifies an unbilled charge.

customer_idstring

A unique identifier for the customer being charged.

subscription_idstring

A unique identifier for the subscription this charge belongs to.

date_frominteger (unix-time)

Start date of this charge.

date_tointeger (unix-time)

End date of this charge.

unit_amountinteger (int64)

Unit amount of the charge item.

pricing_modelstring

The pricing scheme for this line item. \* tiered - There are quantity tiers for which per unit prices are set. Quantities are purchased from successive tiers. \* volume - The per unit price is based on the tier that the total quantity falls in. \* per_unit - A fixed price per unit quantity. \* flat_fee - A fixed price that is not quantity-based. \* stairstep - A quantity-based pricing scheme. The item is charged a fixed price based on the tier that the total quantity falls in.

One offlat_feeper_unittieredvolumestairstep

quantityinteger (int32)

Quantity of the item which is represented by this charge.

amountinteger (int64)

Total amount of this charge. Typically equals to unit amount x quantity.

currency_codestringrequired

The currency code (ISO 4217 format) for the charge.

discount_amountinteger (int64)

Total discounts for this charge.

descriptionstring

Detailed description about this charge.

entity_typestringrequired

Specifies the modelled entity this line item is based on. \* charge_item_price - Indicates that this line item is based on charge Item Price \* addon_item_price - Indicates that this line item is based on addon Item Price \* plan_item_price - Indicates that this line item is based on plan Item Price \* adhoc - Indicates that this lineitem is not modelled. i.e created adhoc. So the 'entity_id' attribute will be null in this case

One ofadhocplan_item_priceaddon_item_pricecharge_item_price

entity_idstring

The identifier of the modelled entity this charge is based on. Will be null for 'adhoc' entity type.

is_voidedbooleanrequired

Will be true if the charge has been voided. Usually the unbilled charge will be voided and revised to different charges(s) during proration.

Default false

voided_atinteger (unix-time)

Timestamp indicating the date and time this charge got voided.

unit_amount_in_decimalstring

The decimal representation of the unit amount for the entity. The value is in major units of the currency. Returned when the entity is quantity-based and [multi-decimal pricing](/docs/api/currencies) is enabled.

quantity_in_decimalstring

The decimal representation of the quantity of this entity. Returned when the entity is quantity-based and [multi-decimal pricing](/docs/api/currencies) is enabled.

amount_in_decimalstring

<p class="mb-2">The decimal representation of the amount for the charge, in major units of the currency. Typically equals to <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">unit_amount_in_decimal</code> x <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">quantity_in_decimal</code>. Returned when <a href="/docs/api/currencies" target="_blank">multi-decimal pricing</a> is enabled.</p>

created_atinteger (unix-time)

Timestamp indicating when the unbilled charge was created.

updated_atinteger (unix-time)required

Timestamp indicating when the unbilled charge was last updated

is_advance_chargeboolean

The value of this parameter will be true if it is a recurring unbilled charge for a future term.

Default false

business_entity_idstring

The unique ID of the [business entity](/docs/api/advanced-features) of this unbilled charge. This is always the same as the [business entity](/docs/api/unbilled_charges/unbilled_charge-object#customer_id) of the customer.

deletedbooleanrequired

Indicates that this resource has been deleted.

tiersarray<object>10 fields

The list of tiers applicable for this line item

json
{
  "unbilled_charges": null
}

Need more? See the Chargebee guide for connection setup and behaviour shared by every action.