You are viewing the documentation for Chargebee API V2. If you're using the older version (V1), click here.

Note: This doc is for the latest version of Chargebee Orders. If you enabled Chargebee Orders before September-30-2018, you may be using the legacy version of the feature and its API. For help in migrating to the current system or using the legacy API for Chargebee Orders, please contact support

Orders are automatically generated for an invoice when it gets paid, based on the shipping preference chosen for the invoice's product and the shipping date configuration. They can be updated either via api or merchant web console (a.k.a admin console).

Sample order [ JSON ]

{ "created_at": 1517678686, "created_by": "full_access_key_v1", "deleted": false, "id": "__test__KyVnHhSBWlm1j2m7", "invoice_id": "__demo_inv__2", "object": "order", "order_type": "manual", "price_type": "tax_exclusive", "status": "new", "status_update_at": 1517678686 }

API Index URL GET

https://{site}.chargebee.com/api/v2/orders
id
string, max chars=40
Uniquely identifies the order. It is the api identifier for the order
document_number
optional, string, max chars=50
The order's serial number
invoice_id
optional, string, max chars=50
The invoice number which acts as an identifier for invoice and is generated sequentially.
subscription_id
optional, string, max chars=50
The subscription for which the order is created
customer_id
optional, string, max chars=50
The customer for which the order is created
status
optional, enumerated string, default=new
The status of this order.
Possible values are
newOrder has been created. Applicable only if you are using Chargebee's legacy order management system.processingOrder is being processed. Applicable only if you are using Chargebee's legacy order management system.completeOrder has been processed successfully. Applicable only if you are using Chargebee's legacy order management system.cancelledOrder has been cancelled. Applicable only if you are using Chargebee's legacy order management system.
voidedOrder has been voided. Applicable only if you are using Chargebee's legacy order management system.queuedOrder is yet to be processed by any system, these are scheduled orders created by Chargebee.awaiting_shipmentThe order has been picked up by an integration system, and synced to a shipping management platform.on_holdThe order is paused from being processed.deliveredThe order has been delivered to the customer.shippedThe order has moved from order management system to a shipping system.partially_deliveredThe order has been partially delivered to the customer.returnedThe order has been returned after delivery.
Show all values[+]
cancellation_reason
optional, enumerated string
Cancellation reason
Possible values are
shipping_cut_off_passedThe invoice has been paid late and Chargebee cancel's the first order for the invoice.product_unsatisfactoryProduct unsatisfactory.third_party_cancellationThird party cancellation.product_not_requiredProduct not required.
delivery_date_missedDelivery date missed.alternative_foundAlternative found.invoice_written_offThe invoice has been completely written off. Orders are generated by Chargebee in cancelled state.invoice_voidedThe invoice for which the order was createed has been voided.fraudulent_transactionFraudulent transaction.payment_declinedPayment declined.subscription_cancelledThe subsctiption for which the order was created has been cancelled.product_not_availableProduct not available.othersOther reason.order_resentOrder resent.
Show all values[+]
payment_status
optional, enumerated string
The payment status of the order
Possible values are
not_paidNOT_PAID.paidPAID.
order_type
optional, enumerated string
Order type
Possible values are
manualThe order has been created by the the user using Chargebee's legacy order management system.system_generatedThe order has been created by Chargebee automatically based on the preferences set by the user.
price_type
enumerated string, default=tax_exclusive
The price type of the order
Possible values are
tax_exclusiveAll amounts in the document are exclusive of tax.tax_inclusiveAll amounts in the document are inclusive of tax.
reference_id
optional, string, max chars=50
Reference id can be used to map the orders in the shipping/order management application to the orders in ChargeBee. The reference_id generally is same as the order id in the third party application.
fulfillment_status
optional, string, max chars=50
The fulfillment status of an order as reflected in the shipping/order management application. Typical statuses include Shipped,Awaiting Shipment,Not fulfilled etc;
order_date
optional, timestamp(UTC) in seconds
The date on which the order will start getting processed.
shipping_date
optional, timestamp(UTC) in seconds
This is the date on which the order will be delivered to the customer.
note
optional, string, max chars=600
The custom note for the order.
tracking_id
optional, string, max chars=50
The tracking id of the order.
tracking_url
optional, string, max chars=255
The tracking url of the order.
batch_id
optional, string, max chars=50
Unique id to identify a group of orders.
created_by
optional, string, max chars=50
The source (or the user) from where the order has been created.
shipment_carrier
optional, string, max chars=50
Shipment carrier
invoice_round_off_amount
optional, in cents, min=0
The total round off taken from the invoice level
tax
optional, in cents, min=0
The total tax for the order.
amount_paid
optional, in cents, min=0
Total amount paid for the order.
amount_adjusted
optional, in cents, min=0
Total amount adjusted for the order.
refundable_credits_issued
optional, in cents, min=0
The total amount issued as credits on behalf of this order.
refundable_credits
optional, in cents, min=0
The total amount that can be issued as credits for this order.
rounding_adjustement
optional, in cents
Rounding adjustment
paid_on
optional, timestamp(UTC) in seconds
The timestamp indicating the date & time the order's invoice got paid.
shipping_cut_off_date
optional, timestamp(UTC) in seconds
The time after which an order becomes unservicable
created_at
timestamp(UTC) in seconds
The time at which the order was created
status_update_at
optional, timestamp(UTC) in seconds
The time at which the order status was last updated.
delivered_at
optional, timestamp(UTC) in seconds
The time at which the order was delivered
shipped_at
optional, timestamp(UTC) in seconds
The time at which the order was shipped.
resource_version
optional, long
Version number of this resource. The resource_version is updated with a new timestamp in milliseconds for every change made to the resource. This attribute will be present only if the resource has been updated after 2016-09-28.
updated_at
optional, timestamp(UTC) in seconds
The order's last modified time.
cancelled_at
optional, timestamp(UTC) in seconds
The time at which the order was cancelled.
resent_status
optional, enumerated string
Resent status of the order.
Possible values are
fully_resentOrder is Fully resent.partially_resentOrder is Partially resent.
is_resent
boolean, default=false
Show if the order is resent order or not.
original_order_id
optional, string, max chars=40
Refers to the original order id of the resent order.
discount
optional, in cents, min=0
Total discount given for the order.
sub_total
optional, in cents, min=0
The order's sub-total
total
optional, in cents, min=0
Total amount charged for the order.
deleted
boolean
Indicates that this resource has been deleted.
currency_code
optional, string, max chars=3
The currency code (ISO 4217 format) for the invoice
is_gifted
optional, boolean, default=false
Boolean indicating whether this order is gifted or not.
gift_note
optional, string, max chars=500
The gift message added by the gifter during purchase
gift_id
optional, string, max chars=50
The gift_id if the order is a gift order
resend_reason
optional, string, max chars=100
Reason code for resending the order. Must be one from a list of reason codes set in the Chargebee app in Settings > Configure Chargebee > Reason Codes > Orders > Order Resend. Must be passed if set as mandatory in the app. The codes are case-sensitive
business_entity_id
optional, string, max chars=50
The ID of the business entity created for the site. For Product Catalog 1.0, all the site data is tied to this business entity.
Note

Multiple Business Entities is a feature available only on Product Catalog 2.0.


order_line_items
Show attributes[+]
optional, list of order_line_item
The list of line items for this order.
Order line item attributes
id
string, max chars=40
The identifier for the order line item.
invoice_id
string, max chars=50
The invoice of the line item.
invoice_line_item_id
string, max chars=40
The invoice line item id associated with this order line item.
unit_price
optional, in cents, min=0
The unit price.
description
optional, string, max chars=250
The line item description.
amount
optional, in cents, min=0
The sub total, of the order line item
fulfillment_quantity
optional, integer, min=0
The quantity that is going to get fulfilled for this order
fulfillment_amount
optional, in cents, min=0
The amount that is going to get fulfilled for this order(amount after tax and discount)
tax_amount
optional, in cents, min=0
The total tax applied on this line item
amount_paid
optional, in cents, min=0
The total amount paid on the invoice, on behalf of this delivery
amount_adjusted
optional, in cents, min=0
The total amount adjusted on the invoice, on behalf of this delivery
refundable_credits_issued
optional, in cents, min=0
The total refundable credits issued on the invoice, on behalf of this delivery
refundable_credits
optional, in cents, min=0
The total amount issued as credits on behalf of this delivery
is_shippable
boolean
Appliable only if configured to include non shippable charges in orders, specifies if the charge is applicable for shipping
sku
optional, string, max chars=250
The SKU for the delivery.
status
optional, enumerated string, default=queued
The status of this order.
Possible values are
queuedNot processed for shipping yet.awaiting_shipmentMoved to shipping platform.on_holdThe delivery has been moved to "On hold" status.deliveredThe order line item has been delivered.shippedThe order line item has been shipped.partially_deliveredThe order has been partially delivered to the customer.returnedThe order has been returned after delivery.cancelledThe order has been returned after delivery.
entity_type
enumerated string
Specifies the modelled entity (plan / addon etc) this line item is based on
Possible values are
plan_setupIndicates that this lineitem is based on 'Plan Setup' charge. The 'entity_id' attribute specifies the plan idplanIndicates that this lineitem is based on 'Plan' entity. The 'entity_id' attribute specifies the plan idaddonIndicates that this lineitem is based on 'Addon' entity. The 'entity_id' attribute specifies the addon idadhocIndicates that this lineitem is not modelled. i.e created adhoc. So the 'entity_id' attribute will be null in this case
item_level_discount_amount
optional, in cents, min=0
Item level discount amount
discount_amount
optional, in cents, min=0
The discount given on the order line item.
entity_id
optional, string, max chars=50
The identifier of the modelled entity this lineitem is based on. Will be null for 'adhoc' entity type
shipping_address
Show attributes[+]
optional, shipping_address
Shipping address for the order.
Shipping address attributes
first_name
optional, string, max chars=150
The first name of the contact.
last_name
optional, string, max chars=150
The last name of the contact.
email
optional, string, max chars=70
The email address.
company
optional, string, max chars=250
The company name.
phone
optional, string, max chars=50
The phone number.
line1
optional, string, max chars=150
Address line 1
line2
optional, string, max chars=150
Address line 2
line3
optional, string, max chars=150
Address line 3
city
optional, string, max chars=50
The name of the city.
state_code
optional, string, max chars=50
The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set state_code as AZ (not US-AZ). For Tamil Nadu (India), set as TN (not IN-TN). For British Columbia (Canada), set as BC (not CA-BC).
state
optional, string, max chars=50
The state/province name.
country
optional, string, max chars=50
The billing address country of the customer. Must be one of ISO 3166 alpha-2 country code.

Note: If you enter an invalid country code, the system will return an error.

Brexit

If you have enabled EU VAT in 2021 or later, or have manually enable the Brexit configuration, then XI (the code for United Kingdom – Northern Ireland) is available as an option.


zip
optional, string, max chars=20
Zip or postal code. The number of characters is validated according to the rules specified here.
validation_status
optional, enumerated string, default=not_validated
The address verification status.
Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
index
integer, min=0, max=4
The index number of the subscription to which the item price is added. Provide a unique number between 0 and 4 (inclusive) for each subscription that is to be created.
billing_address
Show attributes[+]
optional, billing_address
Billing address for the order.
Billing address attributes
first_name
optional, string, max chars=150
The first name of the billing contact.
last_name
optional, string, max chars=150
The last name of the billing contact.
email
optional, string, max chars=70
The email address.
company
optional, string, max chars=250
The company name.
phone
optional, string, max chars=50
The phone number.
line1
optional, string, max chars=150
Address line 1
line2
optional, string, max chars=150
Address line 2
line3
optional, string, max chars=150
Address line 3
city
optional, string, max chars=50
The name of the city.
state_code
optional, string, max chars=50
The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set state_code as AZ (not US-AZ). For Tamil Nadu (India), set as TN (not IN-TN). For British Columbia (Canada), set as BC (not CA-BC).
state
optional, string, max chars=50
State or Province
country
optional, string, max chars=50
The billing address country of the customer. Must be one of ISO 3166 alpha-2 country code.

Note: If you enter an invalid country code, the system will return an error.

Brexit

If you have enabled EU VAT in 2021 or later, or have manually enable the Brexit configuration, then XI (the code for United Kingdom – Northern Ireland) is available as an option.


zip
optional, string, max chars=20
Zip or postal code. The number of characters is validated according to the rules specified here.
validation_status
optional, enumerated string, default=not_validated
The address verification status.
Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
line_item_taxes
Show attributes[+]
optional, list of line_item_tax
The list of taxes applied on the order line items.
Line item tax attributes
line_item_id
optional, string, max chars=40
The unique reference id of the line item for which the tax is applicable
tax_name
string, max chars=100
The name of the tax applied
tax_rate
double, default=0.0, min=0.0, max=100.0
The rate of tax used to calculate tax amount
is_partial_tax_applied
optional, boolean
Indicates if tax is applied only on a portion of the line item amount.
is_non_compliance_tax
optional, boolean
Indicates the non-compliance tax that should not be reported to the jurisdiction.
taxable_amount
in cents, min=0
Indicates the actual portion of the line item amount that is taxable.
tax_amount
in cents, min=0
The tax amount
tax_juris_type
optional, enumerated string
The type of tax jurisdiction
Possible values are
countryThe tax jurisdiction is a countryfederalThe tax jurisdiction is a federalstateThe tax jurisdiction is a statecountyThe tax jurisdiction is a countycityThe tax jurisdiction is a cityspecialSpecial tax jurisdiction.unincorporatedCombined tax of state and county.otherJurisdictions other than the ones listed above.
tax_juris_name
optional, string, max chars=250
The name of the tax jurisdiction
tax_juris_code
optional, string, max chars=250
The tax jurisdiction code
tax_amount_in_local_currency
optional, in cents, min=0
Total tax amount in the currency of the place of supply. This is applicable only for Invoice and Credit Notes API.
local_currency_code
optional, string, max chars=3
The currency code (ISO 4217 format) of the place of supply in which VAT needs to be converted and displayed. This is applicable only for Invoice and Credit Notes API.
line_item_discounts
Show attributes[+]
optional, list of line_item_discount
The list of discounts applied for the order
Line item discount attributes
line_item_id
string, max chars=50
The unique reference id of the line item for which the discount is applicable.
discount_type
enumerated string
Type of this discount line item
Possible values are
item_level_couponRepresents the 'Item' level coupons applied to this invoice. Further the 'coupon_id' attribute specifies the coupon id this discount is based ondocument_level_couponRepresents the 'Document' level coupons applied to this document. Further the 'coupon_id' attribute specifies the coupon id this discount is based onpromotional_creditsRepresents the Promotional Credits item in invoice. The 'coupon_id' attribute will be null in this caseprorated_creditsRepresents the credit adjustment items in invoice. The 'coupon_id' attribute will be null in this casecustom_discountRepresents the discount applied on an resent order against the orginal order.
discount_amount
in cents, min=0
Discount amount.
linked_credit_notes
Show attributes[+]
optional, list of order_line_item_linked_credit
The credit notes linked to the order
Linked credit note attributes
amount
optional, in cents, min=0
The amount issued for this order
type
enumerated string
The credit note type.
Possible values are
adjustmentAdjustment Credit NoterefundableRefundable Credit Note
id
string, max chars=50
Credit-note id.
status
enumerated string
The credit note status.
Possible values are
adjustedWhen the Credit Note has been adjusted against an invoice.refundedWhen the entire credits (Credit Note amount) have been used (i.e either allocated to invoices or refunded).refund_dueWhen the credits are yet to be used, or have been partially used.voidedWhen the Credit Note has been cancelled.
amount_adjusted
optional, in cents, min=0
Total amount adjusted on the order for the linked credit note. Applicable if the linked credit note is of the type 'adjustement'
amount_refunded
optional, in cents, min=0
Total refundable credits issued on the order for the linked credit note. Applicable if the linked credit note is of the type 'refundable'
resent_orders
Show attributes[+]
optional, list of resent_order
The list of resent orders applied on the order.
Resent order attributes
order_id
string, max chars=40
The order which is linked.
reason
optional, string, max chars=100
The order resent reason.
amount
optional, in cents, min=0
Value of the resent order.

Deprecated

Chargebee no longer supports this endpoint, see here for more information. Contact Support for additional assistance or if you have concerns about this update.
Sample Request
curl  https://{site}.chargebee.com/api/v2/orders \
     -u {site_api_key}:\
     -d invoice_id="__demo_inv__2"
copy
curl  https://{site}.chargebee.com/api/v2/orders \
     -u {site_api_key}:\
     -d invoice_id="__demo_inv__2"

Sample Response [ JSON ]

Show more...
{"order": { "created_at": 1517678686, "created_by": "full_access_key_v1", "deleted": false, "id": "__test__KyVnHhSBWlm1j2m7", "invoice_id": "__demo_inv__2", "object": "order", "order_type": "manual", "price_type": "tax_exclusive", "status": "new", "status_update_at": 1517678686 }}

URL Format POST

https://{site}.chargebee.com/api/v2/orders
id
optional, string, max chars=40
Uniquely identifies the order. If not given, this will be auto-generated.
invoice_id
required, string, max chars=50
The invoice number which acts as an identifier for invoice and is generated sequentially.
status
optional, enumerated string
The order status.
Possible values are
newOrder has been created. Applicable only if you are using Chargebee's legacy order management system.processingOrder is being processed. Applicable only if you are using Chargebee's legacy order management systemcompleteOrder has been processed successfully. Applicable only if you are using Chargebee's legacy order management systemcancelledOrder has been cancelled. Applicable only if you are using Chargebee's legacy order management systemvoidedOrder has been voided. Applicable only if you are using Chargebee's legacy order management system
reference_id
optional, string, max chars=50
Reference id can be used to map the orders in the shipping/order management application to the orders in ChargeBee. The reference_id generally is same as the order id in the third party application.
fulfillment_status
optional, string, max chars=50
The fulfillment status of an order as reflected in the shipping/order management application. Typical statuses include Shipped,Awaiting Shipment,Not fulfilled etc;.
note
optional, string, max chars=600
The custom note for the order.
tracking_id
optional, string, max chars=50
The tracking id of the order.
tracking_url
optional, string, max chars=255
The tracking url of the order.
batch_id
optional, string, max chars=50
Unique id to identify a group of orders.
always returned
Resource object representing order
Updates an order. If the status of an order is changed while updating the order, the status_update_at attribute is set with the current time.
Sample Request
curl  https://{site}.chargebee.com/api/v2/orders/1 \
     -u {site_api_key}:\
     -d status="delivered" \
     -d shipped_at=1517073906 \
     -d delivered_at=1517678706
copy

Sample Response [ JSON ]

URL Format POST

https://{site}.chargebee.com/api/v2/orders/{order_id}
reference_id
optional, string, max chars=50
Reference id is the unique identifier of the order in the shipping/order management application.
batch_id
optional, string, max chars=50
Unique id to identify a group of orders.
note
optional, string, max chars=600
The custom note for the order.
shipping_date
optional, timestamp(UTC) in seconds
The date on which the order should be shipped to the customer.
order_date
optional, timestamp(UTC) in seconds
The order date.
cancelled_at
optional, timestamp(UTC) in seconds
The time at which the order was cancelled.
cancellation_reason
optional, enumerated string
Cancellation reason.
Possible values are
shipping_cut_off_passedThe invoice has been paid late and Chargebee cancel's the first order for the invoice.product_unsatisfactoryProduct unsatisfactory.third_party_cancellationThird party cancellation.product_not_requiredProduct not required.
delivery_date_missedDelivery date missed.alternative_foundAlternative found.invoice_written_offThe invoice has been completely written off. Orders are generated by Chargebee in cancelled state.invoice_voidedThe invoice for which the order was createed has been voided.fraudulent_transactionFraudulent transaction.payment_declinedPayment declined.subscription_cancelledThe subsctiption for which the order was created has been cancelled.product_not_availableProduct not available.othersOther reasonorder_resentOrder resent
Show all values[+]
shipped_at
optional, timestamp(UTC) in seconds
The time at which the order was shipped.
delivered_at
optional, timestamp(UTC) in seconds
The time at which the order was delivered.
tracking_url
optional, string, max chars=255
The tracking url of the order.
tracking_id
optional, string, max chars=50
The tracking id of the order.
shipment_carrier
optional, string, max chars=50
The carrier used to ship the goods to the customer. Ex:- FedEx.
fulfillment_status
optional, string, max chars=50
The fulfillment status of an order as reflected in the shipping/order management application. Typical statuses include Shipped,Awaiting Shipment,Not fulfilled etc;.
status
optional, enumerated string
The order status.
Possible values are
newOrder has been created. Applicable only if you are using Chargebee's legacy order management system.processingOrder is being processed. Applicable only if you are using Chargebee's legacy order management systemcompleteOrder has been processed successfully. Applicable only if you are using Chargebee's legacy order management systemcancelledOrder has been cancelled. Applicable only if you are using Chargebee's legacy order management system
voidedOrder has been voided. Applicable only if you are using Chargebee's legacy order management systemqueuedOrder is yet to be processed by any system, these are scheduled orders created by Chargebeeawaiting_shipmentThe order has been picked up by an integration system, and synced to a shipping management platformon_holdThe order is paused from being processed.deliveredThe order has been delivered to the customer.shippedThe order has moved from order management system to a shipping system.partially_deliveredThe order has been partially delivered to the customer.returnedThe order has been returned after delivery.
Show all values[+]
+
shipping_address
Parameters for shipping_address
pass parameters as shipping_address[<param name>]
shipping_address[first_name]
optional, string, max chars=150
The first name of the contact.
shipping_address[last_name]
optional, string, max chars=150
The last name of the contact.
shipping_address[email]
optional, string, max chars=70
The email address.
shipping_address[company]
optional, string, max chars=250
The company name.
shipping_address[phone]
optional, string, max chars=50
The phone number.
shipping_address[line1]
optional, string, max chars=150
Address line 1
shipping_address[line2]
optional, string, max chars=150
Address line 2
shipping_address[line3]
optional, string, max chars=150
Address line 3
shipping_address[city]
optional, string, max chars=50
The name of the city.
shipping_address[state_code]
optional, string, max chars=50
The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set state_code as AZ (not US-AZ). For Tamil Nadu (India), set as TN (not IN-TN). For British Columbia (Canada), set as BC (not CA-BC).
shipping_address[state]
optional, string, max chars=50
The state/province name. Is set by Chargebee automatically for US, Canada and India If state_code is provided.
shipping_address[zip]
optional, string, max chars=20
Zip or postal code. The number of characters is validated according to the rules specified here.
shipping_address[country]
optional, string, max chars=50
The billing address country of the customer. Must be one of ISO 3166 alpha-2 country code.

Note: If you enter an invalid country code, the system will return an error.

Brexit

If you have enabled EU VAT in 2021 or later, or have manually enable the Brexit configuration, then XI (the code for United Kingdom – Northern Ireland) is available as an option.

shipping_address[validation_status]
optional, enumerated string
The address verification status.
Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
+
order_line_items
Parameters for order_line_items. Multiple order_line_items can be passed by specifying unique indices.
pass parameters as order_line_items[<param name>][<idx:0..n>]
order_line_items[id][0..n]
optional, string, max chars=40
The identifier for the order line item.
order_line_items[status][0..n]
optional, enumerated string
The order line item's delivery status
Possible values are
queuedNot processed for shipping yet.awaiting_shipmentMoved to shipping platform.on_holdThe delivery has been moved to "On hold" status.deliveredThe order line item has been delivered.shippedThe order line item has been shipped.partially_deliveredThe order has been partially delivered to the customer.returnedThe order has been returned after delivery.cancelledThe order has been returned after delivery.
order_line_items[sku][0..n]
optional, string, max chars=250
The SKU code for the order line item product
always returned
Resource object representing order
Import an order for an invoice with one or more line items.
This API is not enabled for live sites by default. Please contact support@chargebee.com to get this enabled.
Sample Request
curl  https://{site}.chargebee.com/api/v2/orders/import_order \
     -u {site_api_key}:\
     -d invoice_id="ship_inv" \
     -d subscription_id="__test__sZEDgk5GSLmev7p7J" \
     -d order_date=1519879210 \
     -d status="queued" \
     -d created_at=1517460010 \
     -d shipping_date=1522557610
copy
curl  https://{site}.chargebee.com/api/v2/orders/import_order \
     -u {site_api_key}:\
     -d invoice_id="ship_inv" \
     -d subscription_id="__test__sZEDgk5GSLmev7p7J" \
     -d order_date=1519879210 \
     -d status="queued" \
     -d created_at=1517460010 \
     -d shipping_date=1522557610

Sample Response [ JSON ]

Show more...
{"order": { "amount_adjusted": 0, "amount_paid": 0, "base_currency_code": "USD", "created_at": 1517460010, "created_by": "Auto generated by system", "currency_code": "USD", "customer_id": "__test__sZEDgk5GSLmev7p7J", "deleted": false, "discount": 0, "exchange_rate": 1, "id": "2", "invoice_id": "ship_inv", "is_gifted": false, "linked_credit_notes": [], "object": "order", "order_date": 1519879210, "order_line_items": [ { "amount": 2000, "amount_adjusted": 0, "amount_paid": 0, "description": "shippable plan", "discount_amount": 0, "entity_id": "shippable", "entity_type": "plan", "fulfillment_amount": 2000, "fulfillment_quantity": 1, "id": "o_li__test__sZEDgk5GSLmevt27U", "invoice_id": "ship_inv", "invoice_line_item_id": "li___test__sZEDgk5GSLmevGj7R", "is_shippable": true, "item_level_discount_amount": 0, "object": "order_line_item", "refundable_credits": 0, "refundable_credits_issued": 0, "status": "queued", "tax_amount": 0, "unit_price": 2000 }, {..} ], "order_type": "system_generated", "payment_status": "not_paid", "price_type": "tax_exclusive", "refundable_credits": 0, "refundable_credits_issued": 0, "resource_version": 1517657205622, "rounding_adjustement": 0, "shipping_date": 1522557610, "status": "queued", "sub_total": 2000, "subscription_id": "__test__sZEDgk5GSLmev7p7J", "tax": 0, "total": 2000, "updated_at": 1517657205 }}

URL Format POST

https://{site}.chargebee.com/api/v2/orders/import_order
id
optional, string, max chars=40
Uniquely identifies the order. It is the api identifier for the order.

Order id will always be assigned incrementally from the last generated Order ID.

If Orders imported has an Order ID which is a string, Chargebee will just validate if the Order ID is unique

Recommendation: For orders being imported, set the same prefix and the serial number that is used for the Document number, which will make this into a string. This will ensure that imported orders don't conflict with orders created by Chargebee. Chargebee will ensure there aren’t orders with duplicate Order IDs.
.
document_number
optional, string, max chars=50
The order's serial number.

Document number passed cannot be greater than the series mentioned in the configuration. For instance, if you have set Document number series in Order Configurations with a Prefix as ‘ORDER’ and Starting number as ‘1000’, orders up to the sequence number ‘ORDER999’ can be imported into Chargebee

Recommendation: Set a different prefix at the Order Configuration, than the ones that are imported. If your Order Configuration has a Prefix of ‘NEW’, with Starting number as ‘1’, i.e. ‘NEW1’, then, set Prefix for imported orders to be as ‘OLD’, with Starting number as ‘1’, i.e, ‘OLD1’ .
invoice_id
required, string, max chars=50
The invoice number which acts as an identifier for invoice and is generated sequentially.
status
required, enumerated string, default=new
The status of this order.
Possible values are
cancelledOrder has been cancelled. Applicable only if you are using Chargebee's legacy order management system
queuedOrder is yet to be processed by any system, these are scheduled orders created by Chargebeeawaiting_shipmentThe order has been picked up by an integration system, and synced to a shipping management platformon_holdThe order is paused from being processed.deliveredThe order has been delivered to the customer.shippedThe order has moved from order management system to a shipping system.partially_deliveredThe order has been partially delivered to the customer.returnedThe order has been returned after delivery.
Show all values[+]
subscription_id
optional, string, max chars=50
The subscription for which the order is created.
customer_id
optional, string, max chars=50
The customer for which the order is created.
created_at
required, timestamp(UTC) in seconds
The time at which the order was created.
order_date
required, timestamp(UTC) in seconds
The date on which the order will start getting processed.
shipping_date
required, timestamp(UTC) in seconds
This is the date on which the order has to be shipped to the customer.
reference_id
optional, string, max chars=50
Reference id can be used to map the orders in the shipping/order management application to the orders in ChargeBee. The reference_id generally is the same as the order id in the third party application.

Recommendation:
If this order is in any of these statuses, awaiting_shipment, on_hold, delivered, shipped, partially_delivered, returned, and has already been processed, through a 3rd party system, and you have a reference id of the entity in the 3rd party tool, pass in the entity id to this field. If not, set the same prefix and the serial number that is used for the Document number, which will make this into a string.


If this order hasn’t been processed and is in ‘queued’ status, do not pass any value to this field. Chargebee, when it syncs your Orders through the fulfilment integrations such as Shipstation or Shopify, would auto assign the reference id from the connected system..
fulfillment_status
optional, string, max chars=50
The fulfillment status of an order as reflected in the shipping/order management application. Typical statuses include Shipped,Awaiting Shipment,Not fulfilled etc;.

If this order is in any of these statuses, awaiting_shipment, on_hold, delivered, shipped, partially_delivered, returned, and has already been processed, through a 3rd party system, and you have a corresponding status from the 3rd party tool, pass in the status to this field.

If this order hasn’t been processed and is in ‘queued’ status, do not pass any value to this field. Chargebee, when it syncs your Orders through the fulfilment integrations such as Shipstation or Shopify, would auto assign the fulfilment status from the connected system.
.
note
optional, string, max chars=600
The custom note for the order.
tracking_id
optional, string, max chars=50
The tracking id of the order.
tracking_url
optional, string, max chars=255
The tracking url of the order.
batch_id
optional, string, max chars=50
Unique id to identify a group of orders.
shipment_carrier
optional, string, max chars=50
Shipment carrier.
shipping_cut_off_date
optional, timestamp(UTC) in seconds
The time after which an order becomes unservicable.
delivered_at
optional, timestamp(UTC) in seconds
The time at which the order was delivered.
shipped_at
optional, timestamp(UTC) in seconds
The time at which the order was shipped.
cancelled_at
optional, timestamp(UTC) in seconds
The time at which the order was cancelled.
cancellation_reason
optional, enumerated string
Cancellation reason.
Possible values are
shipping_cut_off_passedThe invoice has been paid late and Chargebee cancel's the first order for the invoice.product_unsatisfactoryProduct unsatisfactory.third_party_cancellationThird party cancellation.product_not_requiredProduct not required.
delivery_date_missedDelivery date missed.alternative_foundAlternative found.invoice_written_offThe invoice has been completely written off. Orders are generated by Chargebee in cancelled state.invoice_voidedThe invoice for which the order was createed has been voided.fraudulent_transactionFraudulent transaction.payment_declinedPayment declined.subscription_cancelledThe subsctiption for which the order was created has been cancelled.product_not_availableProduct not available.othersOther reasonorder_resentOrder resent
Show all values[+]
refundable_credits_issued
optional, in cents, min=0
If there are any credits that were issued at the order level, you can make use of the field, refundable_credits_issued. This will lead to Chargebee creating a Refundable Credit note against the order. When the next invoice is raised against the customer, this credit note will be utilised.
+
shipping_address
Parameters for shipping_address
pass parameters as shipping_address[<param name>]
shipping_address[first_name]
optional, string, max chars=150
The first name of the contact.
shipping_address[last_name]
optional, string, max chars=150
The last name of the contact.
shipping_address[email]
optional, string, max chars=70
The email address.
shipping_address[company]
optional, string, max chars=250
The company name.
shipping_address[phone]
optional, string, max chars=50
The phone number.
shipping_address[line1]
optional, string, max chars=150
Address line 1
shipping_address[line2]
optional, string, max chars=150
Address line 2
shipping_address[line3]
optional, string, max chars=150
Address line 3
shipping_address[city]
optional, string, max chars=50
The name of the city.
shipping_address[state_code]
optional, string, max chars=50
The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set state_code as AZ (not US-AZ). For Tamil Nadu (India), set as TN (not IN-TN). For British Columbia (Canada), set as BC (not CA-BC).
shipping_address[state]
optional, string, max chars=50
The state/province name. Is set by Chargebee automatically for US, Canada and India If state_code is provided.
shipping_address[zip]
optional, string, max chars=20
Zip or postal code. The number of characters is validated according to the rules specified here.
shipping_address[country]
optional, string, max chars=50
The billing address country of the customer. Must be one of ISO 3166 alpha-2 country code.

Note: If you enter an invalid country code, the system will return an error.

Brexit

If you have enabled EU VAT in 2021 or later, or have manually enable the Brexit configuration, then XI (the code for United Kingdom – Northern Ireland) is available as an option.

shipping_address[validation_status]
optional, enumerated string, default=not_validated
The address verification status.
Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
+
billing_address
Parameters for billing_address
pass parameters as billing_address[<param name>]
billing_address[first_name]
optional, string, max chars=150
The first name of the billing contact.
billing_address[last_name]
optional, string, max chars=150
The last name of the billing contact.
billing_address[email]
optional, string, max chars=70
The email address.
billing_address[company]
optional, string, max chars=250
The company name.
billing_address[phone]
optional, string, max chars=50
The phone number.
billing_address[line1]
optional, string, max chars=150
Address line 1
billing_address[line2]
optional, string, max chars=150
Address line 2
billing_address[line3]
optional, string, max chars=150
Address line 3
billing_address[city]
optional, string, max chars=50
The name of the city.
billing_address[state_code]
optional, string, max chars=50
The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set state_code as AZ (not US-AZ). For Tamil Nadu (India), set as TN (not IN-TN). For British Columbia (Canada), set as BC (not CA-BC).
billing_address[state]
optional, string, max chars=50
The state/province name. Is set by Chargebee automatically for US, Canada and India If state_code is provided.
billing_address[zip]
optional, string, max chars=20
Zip or postal code. The number of characters is validated according to the rules specified here.
billing_address[country]
optional, string, max chars=50
The billing address country of the customer. Must be one of ISO 3166 alpha-2 country code.

Note: If you enter an invalid country code, the system will return an error.

Brexit

If you have enabled EU VAT in 2021 or later, or have manually enable the Brexit configuration, then XI (the code for United Kingdom – Northern Ireland) is available as an option.

billing_address[validation_status]
optional, enumerated string, default=not_validated
The address verification status.
Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
always returned
Resource object representing order
Assigns order number to the order based on the settings, if not already assigned
Sample Request
curl  https://{site}.chargebee.com/api/v2/orders/1/assign_order_number \
     -X POST  \
     -u {site_api_key}:
copy
curl  https://{site}.chargebee.com/api/v2/orders/1/assign_order_number \
     -X POST  \
     -u {site_api_key}:

Sample Response [ JSON ]

Show more...
{"order": { "amount_adjusted": 0, "amount_paid": 40000, "base_currency_code": "USD", "created_at": 1517505883, "created_by": "Auto generated by system", "currency_code": "USD", "customer_id": "__test__KyVnHhSBWlkX22lL", "deleted": false, "discount": 0, "document_number": "1", "exchange_rate": 1, "id": "1", "invoice_id": "__demo_inv__1", "is_gifted": false, "linked_credit_notes": [], "object": "order", "order_date": 1517505882, "order_line_items": [ { "amount": 40000, "amount_adjusted": 0, "amount_paid": 40000, "description": "MB1S1P", "discount_amount": 0, "entity_id": "MB1S1P", "entity_type": "plan", "fulfillment_amount": 40000, "fulfillment_quantity": 1, "id": "o_li__test__KyVnGlSBWlkkr25u", "invoice_id": "__demo_inv__1", "invoice_line_item_id": "li___test__KyVnHhSBWlkYO2lN", "is_shippable": true, "item_level_discount_amount": 0, "object": "order_line_item", "refundable_credits": 40000, "refundable_credits_issued": 0, "status": "queued", "tax_amount": 0, "unit_price": 40000 }, {..} ], "order_type": "system_generated", "paid_on": 1517505882, "payment_status": "paid", "price_type": "tax_exclusive", "refundable_credits": 40000, "refundable_credits_issued": 0, "resource_version": 1517678681000, "rounding_adjustement": 0, "shipping_date": 1517505882, "status": "queued", "sub_total": 40000, "subscription_id": "__test__KyVnHhSBWlkX22lL", "tax": 0, "total": 40000, "updated_at": 1517678681 }}

URL Format POST

https://{site}.chargebee.com/api/v2/orders/{order_id}/assign_order_number
always returned
Resource object representing order
Cancel order and create a refundable credit note for the order
Sample Request
curl  https://{site}.chargebee.com/api/v2/orders/1/cancel \
     -X POST  \
     -u {site_api_key}:\
     -d cancellation_reason="product_unsatisfactory" \
     -d customer_notes="Products were defective"
copy
curl  https://{site}.chargebee.com/api/v2/orders/1/cancel \
     -X POST  \
     -u {site_api_key}:\
     -d cancellation_reason="product_unsatisfactory" \
     -d customer_notes="Products were defective"

Sample Response [ JSON ]

Show more...
{"order": { "amount_adjusted": 0, "amount_paid": 40000, "base_currency_code": "USD", "cancellation_reason": "product_unsatisfactory", "cancelled_at": 1517678683, "created_at": 1517505885, "created_by": "Auto generated by system", "currency_code": "USD", "customer_id": "__test__KyVnHhSBWll5K2lX", "deleted": false, "discount": 0, "document_number": "1", "exchange_rate": 1, "id": "1", "invoice_id": "__demo_inv__1", "is_gifted": false, "linked_credit_notes": [], "object": "order", "order_date": 1517505884, "order_line_items": [ { "amount": 40000, "amount_adjusted": 0, "amount_paid": 40000, "description": "MB1S1P", "discount_amount": 0, "entity_id": "MB1S1P", "entity_type": "plan", "fulfillment_amount": 40000, "fulfillment_quantity": 1, "id": "o_li__test__KyVnGlSBWllJc264", "invoice_id": "__demo_inv__1", "invoice_line_item_id": "li___test__KyVnHhSBWll852lZ", "is_shippable": true, "item_level_discount_amount": 0, "object": "order_line_item", "refundable_credits": 40000, "refundable_credits_issued": 0, "status": "queued", "tax_amount": 0, "unit_price": 40000 }, {..} ], "order_type": "system_generated", "paid_on": 1517505884, "payment_status": "paid", "price_type": "tax_exclusive", "refundable_credits": 40000, "refundable_credits_issued": 0, "resource_version": 1517678683000, "rounding_adjustement": 0, "shipping_date": 1517505884, "status": "cancelled", "status_update_at": 1517678683, "sub_total": 40000, "subscription_id": "__test__KyVnHhSBWll5K2lX", "tax": 0, "total": 40000, "updated_at": 1517678683 }}

URL Format POST

https://{site}.chargebee.com/api/v2/orders/{order_id}/cancel
cancellation_reason
required, enumerated string
Cancellation reason.
Possible values are
shipping_cut_off_passedThe invoice has been paid late and Chargebee cancel's the first order for the invoice.product_unsatisfactoryProduct unsatisfactory.third_party_cancellationThird party cancellation.product_not_requiredProduct not required.
delivery_date_missedDelivery date missed.alternative_foundAlternative found.invoice_written_offThe invoice has been completely written off. Orders are generated by Chargebee in cancelled state.invoice_voidedThe invoice for which the order was createed has been voided.fraudulent_transactionFraudulent transaction.payment_declinedPayment declined.subscription_cancelledThe subsctiption for which the order was created has been cancelled.product_not_availableProduct not available.othersOther reasonorder_resentOrder resent
Show all values[+]
customer_notes
optional, string, max chars=2000
The Customer Notes to be filled in the Credit Notes created to capture this refund detail.
comment
optional, string, max chars=300
Comment, if any, on the refund.
cancelled_at
optional, timestamp(UTC) in seconds
The time at which the order was cancelled.
+
credit_note
Parameters for credit_note
pass parameters as credit_note[<param name>]
credit_note[total]
optional, in cents, default=0, min=0
Credit Note amount in cents.
always returned
Resource object representing order
This API is used to create a refundable credit note for the order
Sample Request
curl  https://{site}.chargebee.com/api/v2/orders/1/create_refundable_credit_note \
     -X POST  \
     -u {site_api_key}:\
     -d credit_note[reason_code]="product_unsatisfactory" \
     -d credit_note[total]=100
copy
curl  https://{site}.chargebee.com/api/v2/orders/1/create_refundable_credit_note \
     -X POST  \
     -u {site_api_key}:\
     -d credit_note[reason_code]="product_unsatisfactory" \
     -d credit_note[total]=100

Sample Response [ JSON ]

Show more...
{"order": { "amount_adjusted": 0, "amount_paid": 40000, "base_currency_code": "USD", "created_at": 1517505903, "created_by": "Auto generated by system", "currency_code": "USD", "customer_id": "__test__KyVnHhSBWlpZx2nQ", "deleted": false, "discount": 0, "document_number": "1", "exchange_rate": 1, "id": "1", "invoice_id": "__demo_inv__1", "is_gifted": false, "linked_credit_notes": [ { "amount": 100, "id": "__demo_cn__1", "object": "order_line_item_linked_credit", "status": "refund_due", "type": "refundable" }, {..} ], "object": "order", "order_date": 1517505902, "order_line_items": [ { "amount": 40000, "amount_adjusted": 0, "amount_paid": 40000, "description": "MB1S1P", "discount_amount": 0, "entity_id": "MB1S1P", "entity_type": "plan", "fulfillment_amount": 40000, "fulfillment_quantity": 1, "id": "o_li__test__KyVnGlSBWlpkB272", "invoice_id": "__demo_inv__1", "invoice_line_item_id": "li___test__KyVnHhSBWlpbC2nS", "is_shippable": true, "item_level_discount_amount": 0, "object": "order_line_item", "refundable_credits": 39900, "refundable_credits_issued": 100, "status": "queued", "tax_amount": 0, "unit_price": 40000 }, {..} ], "order_type": "system_generated", "paid_on": 1517505902, "payment_status": "paid", "price_type": "tax_exclusive", "refundable_credits": 39900, "refundable_credits_issued": 100, "resource_version": 1517678701000, "rounding_adjustement": 0, "shipping_date": 1517505902, "status": "queued", "sub_total": 40000, "subscription_id": "__test__KyVnHhSBWlpZx2nQ", "tax": 0, "total": 40000, "updated_at": 1517678701 }}

URL Format POST

https://{site}.chargebee.com/api/v2/orders/{order_id}/create_refundable_credit_note
customer_notes
optional, string, max chars=2000
The Customer Notes to be filled in the Credit Notes created to capture this refund detail.
comment
optional, string, max chars=300
Comment, if any, on the refund.
+
credit_note
Parameters for credit_note
pass parameters as credit_note[<param name>]
credit_note[reason_code]
required, enumerated string
The reason for issuing this Credit Note. The following reason codes are supported now[Deprecated; use the create_reason_code parameter instead]
Possible values are
write_offThis reason will be set automatically for the Credit Notes created during invoice Write Off operation.subscription_changeThis reason will be set automatically for Credit Notes created during Change Subscription operation when proration is enabledsubscription_cancellationThis reason will be set automatically for Credit Notes created during cancel subscription operationsubscription_pauseThis reason will be automatically set to credit notes created during pause/resume subscription operation.
chargebackCan be set when you are recording your customer Chargebacksproduct_unsatisfactoryProduct Unsatisfactoryservice_unsatisfactoryService Unsatisfactoryorder_changeOrder Changeorder_cancellationOrder CancellationwaiverWaiverotherCan be set when none of the above reason codes are applicablefraudulentFRAUDULENT
Show all values[+]
credit_note[total]
required, in cents, default=0, min=0
Credit Note amount in cents.
always returned
Resource object representing order
This API is used to re-open a cancelled order
Sample Request
curl  https://{site}.chargebee.com/api/v2/orders/1/reopen \
     -X POST  \
     -u {site_api_key}:
copy
curl  https://{site}.chargebee.com/api/v2/orders/1/reopen \
     -X POST  \
     -u {site_api_key}:

Sample Response [ JSON ]

Show more...
{"order": { "amount_adjusted": 0, "amount_paid": 40000, "base_currency_code": "USD", "cancelled_at": 1517678702, "created_at": 1517505905, "created_by": "Auto generated by system", "currency_code": "USD", "customer_id": "__test__KyVnHhSBWlq8E2ni", "deleted": false, "discount": 0, "document_number": "1", "exchange_rate": 1, "id": "1", "invoice_id": "__demo_inv__1", "is_gifted": false, "linked_credit_notes": [], "object": "order", "order_date": 1517505904, "order_line_items": [ { "amount": 40000, "amount_adjusted": 0, "amount_paid": 40000, "description": "MB1S1P", "discount_amount": 0, "entity_id": "MB1S1P", "entity_type": "plan", "fulfillment_amount": 40000, "fulfillment_quantity": 1, "id": "o_li__test__KyVnGlSBWlqJO27C", "invoice_id": "__demo_inv__1", "invoice_line_item_id": "li___test__KyVnHhSBWlq9K2nk", "is_shippable": true, "item_level_discount_amount": 0, "object": "order_line_item", "refundable_credits": 40000, "refundable_credits_issued": 0, "status": "queued", "tax_amount": 0, "unit_price": 40000 }, {..} ], "order_type": "system_generated", "paid_on": 1517505904, "payment_status": "paid", "price_type": "tax_exclusive", "refundable_credits": 40000, "refundable_credits_issued": 0, "resource_version": 1517678702000, "rounding_adjustement": 0, "shipping_date": 1517505904, "status": "queued", "status_update_at": 1517678702, "sub_total": 40000, "subscription_id": "__test__KyVnHhSBWlq8E2ni", "tax": 0, "total": 40000, "updated_at": 1517678702 }}

URL Format POST

https://{site}.chargebee.com/api/v2/orders/{order_id}/reopen
void_cancellation_credit_notes
optional, boolean
Flag to void credit notes created for cancellation if they are unused.
always returned
Resource object representing order
Retrieves an order corresponding to the order id passed.
Sample Request
curl  https://{site}.chargebee.com/api/v2/orders/1 \
     -u {site_api_key}:
copy
curl  https://{site}.chargebee.com/api/v2/orders/1 \
     -u {site_api_key}:

Sample Response [ JSON ]

Show more...
{"order": { "amount_adjusted": 0, "amount_paid": 40000, "base_currency_code": "USD", "created_at": 1517505907, "created_by": "Auto generated by system", "currency_code": "USD", "customer_id": "__test__KyVnHhSBWlqc32nw", "deleted": false, "discount": 0, "document_number": "1", "exchange_rate": 1, "id": "1", "invoice_id": "__demo_inv__1", "is_gifted": false, "linked_credit_notes": [], "object": "order", "order_date": 1517505906, "order_line_items": [ { "amount": 40000, "amount_adjusted": 0, "amount_paid": 40000, "description": "MB1S1P", "discount_amount": 0, "entity_id": "MB1S1P", "entity_type": "plan", "fulfillment_amount": 40000, "fulfillment_quantity": 1, "id": "o_li__test__KyVnGlSBWlqm327M", "invoice_id": "__demo_inv__1", "invoice_line_item_id": "li___test__KyVnHhSBWlqdG2ny", "is_shippable": true, "item_level_discount_amount": 0, "object": "order_line_item", "refundable_credits": 40000, "refundable_credits_issued": 0, "status": "queued", "tax_amount": 0, "unit_price": 40000 }, {..} ], "order_type": "system_generated", "paid_on": 1517505906, "payment_status": "paid", "price_type": "tax_exclusive", "refundable_credits": 40000, "refundable_credits_issued": 0, "resource_version": 1517505907000, "rounding_adjustement": 0, "shipping_date": 1517505906, "status": "queued", "sub_total": 40000, "subscription_id": "__test__KyVnHhSBWlqc32nw", "tax": 0, "total": 40000, "updated_at": 1517505907 }}

URL Format GET

https://{site}.chargebee.com/api/v2/orders/{order_id}
always returned
Resource object representing order

Sample admin console URL

https://{site}.chargebee.com/admin-console/orders/123x
Deletes only Imported Order .Delete does not happen if the order was refunded. It goes through if order refund was initiated and is in “refund_due” state.
This API is not enabled for live sites by default. Please contact support@chargebee.com to get this enabled.
Sample Request
curl  https://{site}.chargebee.com/api/v2/orders/2/delete \
     -X POST  \
     -u {site_api_key}:
copy
curl  https://{site}.chargebee.com/api/v2/orders/2/delete \
     -X POST  \
     -u {site_api_key}:

Sample Response [ JSON ]

Show more...
{"order": { "amount_adjusted": 0, "amount_paid": 0, "base_currency_code": "USD", "created_at": 1517460010, "created_by": "Auto generated by system", "currency_code": "USD", "customer_id": "__test__sZEDgk5GSLmfR357m", "deleted": true, "discount": 0, "exchange_rate": 1, "id": "2", "invoice_id": "ship_inv_delete", "is_gifted": false, "linked_credit_notes": [], "object": "order", "order_date": 1519879210, "order_line_items": [ { "amount": 2000, "amount_adjusted": 0, "amount_paid": 0, "description": "shippable plan", "discount_amount": 0, "entity_id": "shippable", "entity_type": "plan", "fulfillment_amount": 2000, "fulfillment_quantity": 1, "id": "o_li__test__sZEDgk5GSLmfR9y7x", "invoice_id": "ship_inv_delete", "invoice_line_item_id": "li___test__sZEDgk5GSLmfR7a7u", "is_shippable": true, "item_level_discount_amount": 0, "object": "order_line_item", "refundable_credits": 0, "refundable_credits_issued": 0, "status": "queued", "tax_amount": 0, "unit_price": 2000 }, {..} ], "order_type": "system_generated", "payment_status": "not_paid", "price_type": "tax_exclusive", "refundable_credits": 0, "refundable_credits_issued": 0, "resource_version": 1517657325813, "rounding_adjustement": 0, "shipping_date": 1522557610, "status": "queued", "sub_total": 2000, "subscription_id": "__test__sZEDgk5GSLmfR357m", "tax": 0, "total": 2000, "updated_at": 1517657325 }}

URL Format POST

https://{site}.chargebee.com/api/v2/orders/{order_id}/delete
always returned
Resource object representing order
This API is used to retrieve a list of all the available orders.
Sample Request
curl  https://{site}.chargebee.com/api/v2/orders \
     -G  \
     -u {site_api_key}:\
     --data-urlencode limit=3 \
     --data-urlencode status[is]="queued"
copy
curl  https://{site}.chargebee.com/api/v2/orders \
     -G  \
     -u {site_api_key}:\
     --data-urlencode limit=3 \
     --data-urlencode status[is]="queued"

Sample Response [ JSON ]

Show more...
{"list": [ {"order": { "amount_adjusted": 0, "amount_paid": 40000, "base_currency_code": "USD", "created_at": 1517505898, "created_by": "Auto generated by system", "currency_code": "USD", "customer_id": "__test__KyVnHhSBWloVR2mr", "deleted": false, "discount": 0, "document_number": "1", "exchange_rate": 1, "id": "1", "invoice_id": "__demo_inv__1", "is_gifted": false, "linked_credit_notes": [], "object": "order", "order_date": 1517505897, "order_line_items": [ { "amount": 40000, "amount_adjusted": 0, "amount_paid": 40000, "description": "MB1S1P", "discount_amount": 0, "entity_id": "MB1S1P", "entity_type": "plan", "fulfillment_amount": 40000, "fulfillment_quantity": 1, "id": "o_li__test__KyVnGlSBWloic26i", "invoice_id": "__demo_inv__1", "invoice_line_item_id": "li___test__KyVnHhSBWloWi2mt", "is_shippable": true, "item_level_discount_amount": 0, "object": "order_line_item", "refundable_credits": 40000, "refundable_credits_issued": 0, "status": "queued", "tax_amount": 0, "unit_price": 40000 }, {..} ], "order_type": "system_generated", "paid_on": 1517505897, "payment_status": "paid", "price_type": "tax_exclusive", "refundable_credits": 40000, "refundable_credits_issued": 0, "resource_version": 1517505898000, "rounding_adjustement": 0, "shipping_date": 1517505897, "status": "queued", "sub_total": 40000, "subscription_id": "__test__KyVnHhSBWloVR2mr", "tax": 0, "total": 40000, "updated_at": 1517505898 }}, {..} ]}

URL Format GET

https://{site}.chargebee.com/api/v2/orders
limit
optional, integer, default=10, min=1, max=100
The number of resources to be returned.
offset
optional, string, max chars=1000
Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set offset to the value of next_offset obtained in the previous iteration of the API call.
include_deleted
optional, boolean, default=false
If set to true, includes the deleted resources in the response. For the deleted resources in the response, the 'deleted' attribute will be 'true'.
sort_by[<sort-order>]
optional, string filter
Sorts based on the specified attribute.
Supported attributes : created_at, updated_at
Supported sort-orders : asc, desc

Example sort_by[asc] = "created_at"
This will sort the result based on the 'created_at' attribute in ascending(earliest first) order.
Filter Params
For operator usages, see the Pagination and Filtering section.
exclude_deleted_credit_notes
optional, boolean
Flag to indicate whether deleted credit notes should be passed or not.
id[<operator>]
optional, string filter
Uniquely identifies the order. It is the api identifier for the order.
Supported operators : is, is_not, starts_with, in, not_in

Example id[is] = "890"
invoice_id[<operator>]
optional, string filter
The invoice number which acts as an identifier for invoice and is generated sequentially.
Supported operators : is, is_not, starts_with, in, not_in

Example invoice_id[is] = "INVOICE_982"
subscription_id[<operator>]
optional, string filter
The subscription for which the order is created.
Supported operators : is, is_not, starts_with

Example subscription_id[is] = "null"
status[<operator>]
optional, enumerated string filter
The status of this order. Possible values are : new, processing, complete, cancelled, voided, queued, awaiting_shipment, on_hold, delivered, shipped, partially_delivered, returned.
Supported operators : is, is_not, in, not_in

Example status[is] = "queued"
shipping_date[<operator>]
optional, timestamp(UTC) in seconds filter
This is the date on which the order will be delivered to the customer.
Supported operators : after, before, on, between

Example shipping_date[before] = "1435054328"
shipped_at[<operator>]
optional, timestamp(UTC) in seconds filter
The time at which the order was shipped.
Supported operators : after, before, on, between

Example shipped_at[on] = "1435054328"
order_type[<operator>]
optional, enumerated string filter
Order type. Possible values are : manual, system_generated.
Supported operators : is, is_not, in, not_in

Example order_type[is] = "system_generated"
order_date[<operator>]
optional, timestamp(UTC) in seconds filter
The date on which the order will start getting processed.
Supported operators : after, before, on, between

Example order_date[after] = "1435054328"
paid_on[<operator>]
optional, timestamp(UTC) in seconds filter
The timestamp indicating the date & time the order's invoice got paid.
Supported operators : after, before, on, between

Example paid_on[before] = "1435054328"
updated_at[<operator>]
optional, timestamp(UTC) in seconds filter
To filter based on updated at .
Supported operators : after, before, on, between

Example updated_at[on] = "1243545465"
created_at[<operator>]
optional, timestamp(UTC) in seconds filter
The time at which the order was created.
Supported operators : after, before, on, between

Example created_at[after] = "1435054328"
resent_status[<operator>]
optional, enumerated string filter
Resent order status. Possible values are : fully_resent, partially_resent.
Supported operators : is, is_not, in, not_in

Example resent_status[is] = "fully_resent"
is_resent[<operator>]
optional, boolean filter
Order is resent order or not. Possible values are : true, false
Supported operators : is

Example is_resent[is] = "false"
original_order_id[<operator>]
optional, string filter
If resent order what is the parent order id.
Supported operators : is, is_not, starts_with

Example original_order_id[is_not] = "1xRt6ifdr"
always returned
Resource object representing order
next_offset
optional, string, max chars=1000
This attribute is returned only if more resources are present. To fetch the next set of resources use this value for the input parameter “offset”.
Resend an existing order. This will help in resending an existing order in full or partial. Upto 5 resend operations are allowed per . When resent fully, the original order is canceled.
Sample Request
curl  https://{site}.chargebee.com/api/v2/orders/1/resend \
     -X POST  \
     -u {site_api_key}:\
     -d shipping_date=1517675618 \
     -d resend_reason="Damaged"
copy

Sample Response [ JSON ]

URL Format POST

https://{site}.chargebee.com/api/v2/orders/{order_id}/resend
shipping_date
optional, timestamp(UTC) in seconds
The date on which the order should be shipped to the customer.
resend_reason
optional, string, max chars=100
Reason code for resending the order. Must be one from a list of reason codes set in the Chargebee app in Settings > Configure Chargebee > Reason Codes > Orders > Order Resend. Must be passed if set as mandatory in the app. The codes are case-sensitive.
+
order_line_items
Parameters for order_line_items. Multiple order_line_items can be passed by specifying unique indices.
pass parameters as order_line_items[<param name>][<idx:0..n>]
order_line_items[id][0..n]
optional, string, max chars=40
The identifier for the order line item.
order_line_items[fulfillment_quantity][0..n]
optional, integer, min=0
The quantity that is going to get fulfilled for this order
always returned
Resource object representing order