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).
string, max chars=40
Uniquely identifies the order. It is the api identifier for the order
optional, string, max chars=50
The order's serial number
optional, string, max chars=50
The invoice number which acts as an identifier for invoice and is generated sequentially.
optional, string, max chars=50
The subscription for which the order is created
optional, string, max chars=50
The customer for which the order is created
optional, enumerated string, default=newThe 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[+]
optional, enumerated stringCancellation 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[+]
optional, enumerated stringThe payment status of the order
Possible values are
not_paidNOT_PAID.paidPAID.
optional, enumerated stringOrder 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.
enumerated string, default=tax_exclusiveThe 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.
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.
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;
optional, timestamp(UTC) in seconds
The date on which the order will start getting processed.
optional, timestamp(UTC) in seconds
This is the date on which the order will be delivered to the customer.
optional, string, max chars=600
The custom note for the order.
optional, string, max chars=50
The tracking id of the order.
optional, string, max chars=255
The tracking url of the order.
optional, string, max chars=50
Unique id to identify a group of orders.
optional, string, max chars=50
The source (or the user) from where the order has been created.
optional, string, max chars=50
Shipment carrier
optional, in cents, min=0
The total round off taken from the invoice level
optional, in cents, min=0
The total tax for the order.
optional, in cents, min=0
Total amount paid for the order.
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.
optional, in cents, min=0
The total amount that can be issued as credits for this order.
optional, in cents
Rounding adjustment
optional, timestamp(UTC) in seconds
The timestamp indicating the date & time the order's invoice got paid.
optional, timestamp(UTC) in seconds
The time after which an order becomes unservicable
timestamp(UTC) in seconds
The time at which the order was created
optional, timestamp(UTC) in seconds
The time at which the order status was last updated.
optional, timestamp(UTC) in seconds
The time at which the order was delivered
optional, timestamp(UTC) in seconds
The time at which the order was shipped.
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.
optional, timestamp(UTC) in seconds
The order's last modified time.
optional, timestamp(UTC) in seconds
The time at which the order was cancelled.
optional, enumerated stringResent status of the order.
Possible values are
fully_resentOrder is Fully resent.partially_resentOrder is Partially resent.
boolean, default=false
Show if the order is resent order or not.
optional, string, max chars=40
Refers to the original order id of the resent order.
optional, in cents, min=0
Total discount given for the order.
optional, in cents, min=0
The order's sub-total
optional, in cents, min=0
Total amount charged for the order.
boolean
Indicates that this resource has been deleted.
optional, string, max chars=3
The currency code (ISO 4217 format) for the invoice
optional, boolean, default=false
Boolean indicating whether this order is gifted or not.
optional, string, max chars=500
The gift message added by the gifter during purchase
optional, string, max chars=50
The gift_id if the order is a gift order
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
optional, string, max chars=50The unique ID of the
business entity of this subscription. This is always the same as the
business entity of the customer.
optional, list of order_line_item
The list of line items for this order.
Order line item attributes
string, max chars=40
The identifier for the order line item.
string, max chars=50
The invoice of the line item.
string, max chars=40
The invoice line item id associated with this order line item.
optional, in cents, min=0
The unit price.
optional, string, max chars=250
The line item description.
optional, in cents, min=0
The sub total, of the order line item
optional, integer, min=0
The quantity that is going to get fulfilled for this order
optional, in cents, min=0
The amount that is going to get fulfilled for this order(amount after tax and discount)
optional, in cents, min=0
The total tax applied on this line item
optional, in cents, min=0
The total amount paid on the invoice, on behalf of this delivery
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
optional, in cents, min=0
The total amount issued as credits on behalf of this delivery
boolean
Appliable only if configured to include non shippable charges in orders, specifies if the charge is applicable for shipping
optional, string, max chars=250
The SKU for the delivery.
optional, enumerated string, default=queuedThe 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.
enumerated stringSpecifies the modelled entity (
plan /
addon etc) this line item is based on
Possible values are
adhocIndicates that this lineitem is not modelled. i.e created adhoc. So the 'entity_id' attribute will be null in this caseplan_item_priceIndicates that this line item is based on plan Item Priceaddon_item_priceIndicates that this line item is based on addon Item Pricecharge_item_priceIndicates that this line item is based on charge Item Price
item_level_discount_amount
optional, in cents, min=0
Item level discount amount
optional, in cents, min=0
The discount given on the order line item.
optional, string, max chars=50
The identifier of the modelled entity this lineitem is based on. Will be null for 'adhoc' entity type
optional, shipping_address
Shipping address for the order.
Shipping address attributes
optional, string, max chars=150
The first name of the contact.
optional, string, max chars=150
The last name of the contact.
optional, string, max chars=70
The email address.
optional, string, max chars=250
The company name.
optional, string, max chars=50
The phone number.
optional, string, max chars=150
Address line 1
optional, string, max chars=150
Address line 2
optional, string, max chars=150
Address line 3
optional, string, max chars=50
The name of the city.
optional, string, max chars=50The
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
).
optional, string, max chars=50
The state/province name.
optional, string, max chars=50The 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.
optional, string, max chars=20Zip or postal code. The number of characters is validated according to the rules
specified here.
optional, enumerated string, default=not_validatedThe 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.
integer, min=0
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.
optional, billing_address
Billing address for the order.
Billing address attributes
optional, string, max chars=150
The first name of the billing contact.
optional, string, max chars=150
The last name of the billing contact.
optional, string, max chars=70
The email address.
optional, string, max chars=250
The company name.
optional, string, max chars=50
The phone number.
optional, string, max chars=150
Address line 1
optional, string, max chars=150
Address line 2
optional, string, max chars=150
Address line 3
optional, string, max chars=50
The name of the city.
optional, string, max chars=50The
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
).
optional, string, max chars=50
State or Province
optional, string, max chars=50The 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.
optional, string, max chars=20Zip or postal code. The number of characters is validated according to the rules
specified here.
optional, enumerated string, default=not_validatedThe 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.
optional, list of line_item_tax
The list of taxes applied on the order line items.
optional, string, max chars=40
The unique reference id of the line item for which the tax is applicable
string, max chars=100
The name of the tax applied
double, default=0.0, min=0.0, max=100.0
The rate of tax used to calculate tax amount
optional, boolean
Indicates if tax is applied only on a portion of the line item amount.
optional, boolean
Indicates the non-compliance tax that should not be reported to the jurisdiction.
in cents, min=0
Indicates the actual portion of the line item amount that is taxable.
in cents, min=0
The tax amount
optional, enumerated stringThe 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.
optional, string, max chars=250
The name of the tax jurisdiction
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.
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.
optional, list of line_item_discount
The list of discounts applied for the order
Line item discount attributes
string, max chars=50
The unique reference id of the line item for which the discount is applicable.
enumerated stringType 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.item_level_discountThe deduction is due to a discount applied to a line item of the invoice. The discount id is available as the entity_id
. document_level_discountThe deduction is due to a discount applied to the invoice sub_total
. The discount id is available as the entity_id
.
optional, string, max chars=50When the deduction is due to a
coupon
or a
discount
, then this is the
id
of the coupon or discount.
in cents, min=0
Discount amount.
optional, list of order_line_item_linked_credit
The credit notes linked to the order
Linked credit note attributes
optional, in cents, min=0
The amount issued for this order
enumerated stringThe credit note type.
Possible values are
adjustmentAdjustment Credit NoterefundableRefundable Credit Note
string, max chars=50
Credit-note id.
enumerated stringThe 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.
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'
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'
optional, list of resent_order
The list of resent orders applied on the order.
string, max chars=40
The order which is linked.
optional, string, max chars=100
The order resent reason.
optional, in cents, min=0
Value of the resent order.
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
optional, string, max chars=40
Uniquely identifies the order. If not given, this will be auto-generated.
required, string, max chars=50
The invoice number which acts as an identifier for invoice and is generated sequentially.
optional, enumerated stringThe 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
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.
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;.
optional, string, max chars=600
The custom note for the order.
optional, string, max chars=50
The tracking id of the order.
optional, string, max chars=255
The tracking url of the order.
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
curl https://{site}.chargebee.com/api/v2/orders/1 \
-u {site_api_key}:\
-d status="delivered" \
-d shipped_at=1517073906 \
-d delivered_at=1517678706
# updates the order shipping address.
curl https://{site}.chargebee.com/api/v2/orders/__test__KyVnHhSBWlrq92oh \
-u {site_api_key}:\
-d shipping_address[first_name]="John" \
-d shipping_address[last_name]="Doe" \
-d shipping_address[email]="john@user.com" \
-d shipping_address[line1]="PO Box 9999" \
-d shipping_address[city]="Walnut" \
-d shipping_address[state]="California" \
-d shipping_address[zip]="91789" \
-d shipping_address[country]="US"
Sample Response [ JSON ]
Show more...
{"order": {
"amount_adjusted": 0,
"amount_paid": 40000,
"base_currency_code": "USD",
"created_at": 1517505909,
"created_by": "Auto generated by system",
"currency_code": "USD",
"customer_id": "__test__KyVnHhSBWlr4r2o7",
"deleted": false,
"delivered_at": 1517678706,
"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": 1517505907,
"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__KyVnGlSBWlrF727W",
"invoice_id": "__demo_inv__1",
"invoice_line_item_id": "li___test__KyVnHhSBWlr692o9",
"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": 1517505907,
"payment_status": "paid",
"price_type": "tax_exclusive",
"refundable_credits": 40000,
"refundable_credits_issued": 0,
"resource_version": 1517678706000,
"rounding_adjustement": 0,
"shipped_at": 1517073906,
"shipping_date": 1517505907,
"status": "delivered",
"status_update_at": 1517678706,
"sub_total": 40000,
"subscription_id": "__test__KyVnHhSBWlr4r2o7",
"tax": 0,
"total": 40000,
"updated_at": 1517678706
}}
Show more...
{"order": {
"created_at": 1517678708,
"created_by": "full_access_key_v1",
"deleted": false,
"id": "__test__KyVnHhSBWlrq92oh",
"invoice_id": "__demo_inv__2",
"object": "order",
"order_type": "manual",
"price_type": "tax_exclusive",
"status": "new",
"status_update_at": 1517678708
}}
URL Format POST
https://{site}.chargebee.com/api/v2/orders/{order_id}
optional, string, max chars=50
Reference id is the unique identifier of the order in the shipping/order management application.
optional, string, max chars=50
Unique id to identify a group of orders.
optional, string, max chars=600
The custom note for the order.
optional, timestamp(UTC) in seconds
The date on which the order should be shipped to the customer.
optional, timestamp(UTC) in seconds
The order date.
optional, timestamp(UTC) in seconds
The time at which the order was cancelled.
optional, enumerated stringCancellation 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[+]
optional, timestamp(UTC) in seconds
The time at which the order was shipped.
optional, timestamp(UTC) in seconds
The time at which the order was delivered.
optional, string, max chars=255
The tracking url of the order.
optional, string, max chars=50
The tracking id of the order.
optional, string, max chars=50
The carrier used to ship the goods to the customer. Ex:- FedEx.
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;.
optional, enumerated stringThe 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 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[+]
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.
optional, string, max chars=70
The email address.
shipping_address[company]
optional, string, max chars=250
The company name.
optional, string, max chars=50
The phone number.
optional, string, max chars=150
Address line 1
optional, string, max chars=150
Address line 2
optional, string, max chars=150
Address line 3
optional, string, max chars=50
The name of the city.
shipping_address[state_code]
optional, string, max chars=50The
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
).
optional, string, max chars=50
The state/province name. Is set by Chargebee automatically for US, Canada and India If state_code
is provided.
optional, string, max chars=20Zip or postal code. The number of characters is validated according to the rules
specified here.
shipping_address[country]
optional, string, max chars=50The 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 stringThe 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.
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 stringThe 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. The import order bulk operation is to be applied on an imported invoice.
This API is not enabled for live sites by default. Please contact
support 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
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.
.
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’
.
required, string, max chars=50
The invoice number which acts as an identifier for invoice and is generated sequentially.
required, enumerated string, default=newThe status of this order.
Possible values are
cancelledOrder has been cancelled. 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[+]
optional, string, max chars=50
The subscription for which the order is created.
optional, string, max chars=50
The customer for which the order is created.
required, timestamp(UTC) in seconds
The time at which the order was created.
required, timestamp(UTC) in seconds
The date on which the order will start getting processed.
required, timestamp(UTC) in seconds
This is the date on which the order has to be shipped to the customer.
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..
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.
.
optional, string, max chars=600
The custom note for the order.
optional, string, max chars=50
The tracking id of the order.
optional, string, max chars=255
The tracking url of the order.
optional, string, max chars=50
Unique id to identify a group of orders.
optional, string, max chars=50
Shipment carrier.
optional, timestamp(UTC) in seconds
The time after which an order becomes unservicable.
optional, timestamp(UTC) in seconds
The time at which the order was delivered.
optional, timestamp(UTC) in seconds
The time at which the order was shipped.
optional, timestamp(UTC) in seconds
The time at which the order was cancelled.
optional, enumerated stringCancellation 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.
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.
optional, string, max chars=70
The email address.
shipping_address[company]
optional, string, max chars=250
The company name.
optional, string, max chars=50
The phone number.
optional, string, max chars=150
Address line 1
optional, string, max chars=150
Address line 2
optional, string, max chars=150
Address line 3
optional, string, max chars=50
The name of the city.
shipping_address[state_code]
optional, string, max chars=50The
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
).
optional, string, max chars=50
The state/province name. Is set by Chargebee automatically for US, Canada and India If state_code
is provided.
optional, string, max chars=20Zip or postal code. The number of characters is validated according to the rules
specified here.
shipping_address[country]
optional, string, max chars=50The 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_validatedThe 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.
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.
optional, string, max chars=70
The email address.
optional, string, max chars=250
The company name.
optional, string, max chars=50
The phone number.
optional, string, max chars=150
Address line 1
optional, string, max chars=150
Address line 2
optional, string, max chars=150
Address line 3
optional, string, max chars=50
The name of the city.
billing_address[state_code]
optional, string, max chars=50The
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
).
optional, string, max chars=50
The state/province name. Is set by Chargebee automatically for US, Canada and India If state_code
is provided.
optional, string, max chars=20Zip or postal code. The number of characters is validated according to the rules
specified here.
optional, string, max chars=50The 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_validatedThe 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
required, enumerated stringCancellation 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[+]
optional, string, max chars=2000
The Customer Notes to be filled in the Credit Notes created to capture this refund detail.
optional, string, max chars=300
Comment, if any, on the refund.
optional, timestamp(UTC) in seconds
The time at which the order was cancelled.
Parameters for credit_note
pass parameters as credit_note[<param name>]
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
optional, string, max chars=2000
The Customer Notes to be filled in the Credit Notes created to capture this refund detail.
optional, string, max chars=300
Comment, if any, on the refund.
Parameters for credit_note
pass parameters as credit_note[<param name>]
required, enumerated stringThe 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[+]
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 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
optional, integer, default=10, min=1, max=100
The number of resources to be returned.
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.
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'.
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.
exclude_deleted_credit_notes
optional, boolean
Flag to indicate whether deleted credit notes should be passed or not.
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"
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"
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[after] = "1435054328"
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"
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"
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[before] = "1435054328"
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[on] = "1435054328"
optional, timestamp(UTC) in seconds filter
To filter based on updated at .
Supported operators : after, before, on, between
Example → updated_at[after] = "1243545465"
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_not] = "fully_resent"
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] = "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
curl https://{site}.chargebee.com/api/v2/orders/1/resend \
-X POST \
-u {site_api_key}:\
-d shipping_date=1517675618 \
-d resend_reason="Damaged"
curl https://{site}.chargebee.com/api/v2/orders/1/resend \
-X POST \
-u {site_api_key}:\
-d shipping_date=1517675620 \
-d resend_reason="Damaged" \
-d order_line_items[id][0]="o_li__test__5SK1MsCBSJFzUUE39" \
-d order_line_items[fulfillment_quantity][0]=1
Sample Response [ JSON ]
Show more...
{"order": {
"amount_adjusted": 0,
"amount_paid": 0,
"base_currency_code": "USD",
"created_at": 1517675018,
"created_by": "Manually generated by user",
"currency_code": "USD",
"customer_id": "__test__sZEDgk7tSJFzTSYZ",
"deleted": false,
"discount": 40000,
"document_number": "2",
"exchange_rate": 1,
"id": "2",
"invoice_id": "__demo_inv__1",
"is_gifted": false,
"is_resent": true,
"line_item_discounts": [
{
"discount_amount": 40000,
"discount_type": "custom_discount",
"line_item_id": "li___test__sZEDgk7tSJFzTUsb",
"object": "line_item_discount"
},
{..}
],
"linked_credit_notes": [],
"object": "order",
"order_date": 1517675018,
"order_line_items": [
{
"amount": 40000,
"amount_adjusted": 0,
"amount_paid": 0,
"description": "MB1S1P",
"discount_amount": 40000,
"entity_id": "MB1S1P",
"entity_type": "plan",
"fulfillment_amount": 0,
"fulfillment_quantity": 1,
"id": "o_li__test__sZEDgk7tSJFzU5to",
"invoice_id": "__demo_inv__1",
"invoice_line_item_id": "li___test__sZEDgk7tSJFzTUsb",
"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": 40000
},
{..}
],
"order_type": "system_generated",
"original_order_id": 464000000004,
"price_type": "tax_exclusive",
"refundable_credits": 0,
"refundable_credits_issued": 0,
"resend_reason": "Damaged",
"resource_version": 1517675019129,
"rounding_adjustement": 0,
"shipping_date": 1517675618,
"status": "queued",
"sub_total": 0,
"subscription_id": "__test__sZEDgk7tSJFzTSYZ",
"tax": 0,
"total": 0,
"updated_at": 1517675019
}}
Show more...
{"order": {
"amount_adjusted": 0,
"amount_paid": 0,
"base_currency_code": "USD",
"created_at": 1517675020,
"created_by": "Manually generated by user",
"currency_code": "USD",
"customer_id": "__test__sZEDgk7tSJFzUDvv",
"deleted": false,
"discount": 40000,
"document_number": "2",
"exchange_rate": 1,
"id": "2",
"invoice_id": "__demo_inv__1",
"is_gifted": false,
"is_resent": true,
"line_item_discounts": [
{
"discount_amount": 40000,
"discount_type": "custom_discount",
"line_item_id": "li___test__sZEDgk7tSJFzUGHx",
"object": "line_item_discount"
},
{..}
],
"linked_credit_notes": [],
"object": "order",
"order_date": 1517675020,
"order_line_items": [
{
"amount": 40000,
"amount_adjusted": 0,
"amount_paid": 0,
"description": "MB1S1P",
"discount_amount": 40000,
"entity_id": "MB1S1P",
"entity_type": "plan",
"fulfillment_amount": 0,
"fulfillment_quantity": 1,
"id": "o_li__test__sZEDgk7tSJFzUZM1A",
"invoice_id": "__demo_inv__1",
"invoice_line_item_id": "li___test__sZEDgk7tSJFzUGHx",
"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": 40000
},
{..}
],
"order_type": "system_generated",
"original_order_id": 464000000006,
"price_type": "tax_exclusive",
"refundable_credits": 0,
"refundable_credits_issued": 0,
"resend_reason": "Damaged",
"resource_version": 1517675020737,
"rounding_adjustement": 0,
"shipping_date": 1517675620,
"status": "queued",
"sub_total": 0,
"subscription_id": "__test__sZEDgk7tSJFzUDvv",
"tax": 0,
"total": 0,
"updated_at": 1517675020
}}
URL Format POST
https://{site}.chargebee.com/api/v2/orders/{order_id}/resend
optional, timestamp(UTC) in seconds
The date on which the order should be shipped to the customer.
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.
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