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).
{
"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
}
curl https://{site}.chargebee.com/api/v2/orders \ -u {site_api_key}:\ -d invoice_id="__demo_inv__2"
curl https://{site}.chargebee.com/api/v2/orders \ -u {site_api_key}:\ -d invoice_id="__demo_inv__2"
curl https://{site}.chargebee.com/api/v2/orders/1 \ -u {site_api_key}:\ -d status="DELIVERED" \ -d shipped_at=1517073906 \ -d delivered_at=1517678706
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"
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_code
is provided. 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.
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
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
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_code
is provided. 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.
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_code
is provided. 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.
curl https://{site}.chargebee.com/api/v2/orders/1/assign_order_number \ -X POST \ -u {site_api_key}:
curl https://{site}.chargebee.com/api/v2/orders/1/assign_order_number \ -X POST \ -u {site_api_key}:
curl https://{site}.chargebee.com/api/v2/orders/1/cancel \ -u {site_api_key}:\ -d cancellation_reason="PRODUCT_UNSATISFACTORY" \ -d customer_notes="Products were defective"
curl https://{site}.chargebee.com/api/v2/orders/1/cancel \ -u {site_api_key}:\ -d cancellation_reason="PRODUCT_UNSATISFACTORY" \ -d customer_notes="Products were defective"
curl https://{site}.chargebee.com/api/v2/orders/1/create_refundable_credit_note \ -u {site_api_key}:\ -d "credit_note[reason_code]"="PRODUCT_UNSATISFACTORY" \ -d "credit_note[total]"=100
curl https://{site}.chargebee.com/api/v2/orders/1/create_refundable_credit_note \ -u {site_api_key}:\ -d "credit_note[reason_code]"="PRODUCT_UNSATISFACTORY" \ -d "credit_note[total]"=100
curl https://{site}.chargebee.com/api/v2/orders/1/reopen \ -X POST \ -u {site_api_key}:
curl https://{site}.chargebee.com/api/v2/orders/1/reopen \ -X POST \ -u {site_api_key}:
curl https://{site}.chargebee.com/api/v2/orders/1 \ -u {site_api_key}:
curl https://{site}.chargebee.com/api/v2/orders/1 \ -u {site_api_key}:
curl https://{site}.chargebee.com/api/v2/orders/2/delete \ -X POST \ -u {site_api_key}:
curl https://{site}.chargebee.com/api/v2/orders/2/delete \ -X POST \ -u {site_api_key}:
curl https://{site}.chargebee.com/api/v2/orders \ -G \ -u {site_api_key}:\ --data-urlencode limit=3 \ --data-urlencode "status[is]"="queued"
curl https://{site}.chargebee.com/api/v2/orders \ -G \ -u {site_api_key}:\ --data-urlencode limit=3 \ --data-urlencode "status[is]"="queued"
curl https://{site}.chargebee.com/api/v2/orders/1/resend \ -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