POST /orders/import_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.

Servers

Request headers

Name Type Required Description
chargebee-request-origin-device String No

The device from which the customer has made the request

Content-Type String Yes The media type of the request body.

Default value: "application/x-www-form-urlencoded"

chargebee-event-webhook String No

skip only webhooks

Possible values:

  • "all-disabled"
chargebee-business-entity-id String No

If the site has multiple business entities, you can use this custom HTTP header to specify the business entity for which Chargebee should perform the operation.

chargebee-event-actions String No

skip all actions to be done on the events

Possible values:

  • "all-disabled"
chargebee-request-origin-user String No

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

chargebee-request-origin-ip String No

The IP address of the customer where the request originated

chargebee-request-origin-user-encoded String No

The Base64-encoded email address of your customer/user. Use this if the email address has UTF-8 characters. When this header is provided, the header chargebee-request-origin-user is ignored.

chargebee-event-email String No

skip only emails

Possible values:

  • "all-disabled"

Request body fields

Name Type Required Description
shipping_address Object No

Parameters for shipping_address

shipping_address.first_name String No

The first name of the contact.

shipping_address.state String No

The state/province name. Is set by Chargebee automatically for US, Canada and India If state_code is provided.

shipping_address.city String No

The name of the city.

shipping_address.validation_status String No

The address verification status. * partially_valid - The address is valid for taxability but has not been validated for shipping. * invalid - Address is invalid. * not_validated - Address is not yet validated. * valid - Address was validated successfully.

Possible values:

  • "partially_valid"
  • "valid"
  • "not_validated"
  • "invalid"

Default value: "not_validated"

shipping_address.line2 String No

Address line 2

shipping_address.line1 String No

Address line 1

shipping_address.email String No

The email address.

shipping_address.last_name String No

The last name of the contact.

shipping_address.company String No

The company name.

shipping_address.line3 String No

Address line 3

shipping_address.state_code String No

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.zip String No

Zip or postal code. The number of characters is validated according to the rules specified here.

shipping_address.phone String No

The phone number.

shipping_address.country String No

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.

refundable_credits_issued Integer No

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.

tracking_id String No

The tracking id of the order.

tracking_url String No

The tracking url of the order.

shipping_date Integer Yes

This is the date on which the order has to be shipped to the customer.

shipped_at Integer No

The time at which the order was shipped.

status String Yes

The status of this order. * voided - Order has been voided. Applicable only if you are using Chargebee's legacy order management system * complete - Order has been processed successfully. Applicable only if you are using Chargebee's legacy order management system * shipped - The order has moved from order management system to a shipping system. * processing - Order is being processed. Applicable only if you are using Chargebee's legacy order management system * queued - Order is yet to be processed by any system, these are scheduled orders created by Chargebee * on_hold - The order is paused from being processed. * new - Order has been created. Applicable only if you are using Chargebee's legacy order management system. * returned - The order has been returned after delivery. * delivered - The order has been delivered to the customer. * awaiting_shipment - The order has been picked up by an integration system, and synced to a shipping management platform * cancelled - Order has been cancelled. Applicable only if you are using Chargebee's legacy order management system * partially_delivered - The order has been partially delivered to the customer.

Possible values:

  • "shipped"
  • "returned"
  • "on_hold"
  • "queued"
  • "awaiting_shipment"
  • "delivered"
  • "cancelled"
  • "partially_delivered"
document_number String No

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'.

shipping_cut_off_date Integer No

The time after which an order becomes unservicable.

reference_id String No

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..

id String No

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.*.

batch_id String No

Unique id to identify a group of orders.

delivered_at Integer No

The time at which the order was delivered.

customer_id String No

The customer for which the order is created.

note String No

The custom note for the order.

shipment_carrier String No

Shipment carrier.

invoice_id String Yes

The invoice number which acts as an identifier for invoice and is generated sequentially.

cancelled_at Integer No

The time at which the order was cancelled.

fulfillment_status String No

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.*.

cancellation_reason String No

Cancellation reason. * shipping_cut_off_passed - The invoice has been paid late and Chargebee cancel's the first order for the invoice. * invoice_voided - The invoice for which the order was createed has been voided. * alternative_found - Alternative found. * others - Other reason * order_resent - Order resent * product_unsatisfactory - Product unsatisfactory. * delivery_date_missed - Delivery date missed. * subscription_cancelled - The subsctiption for which the order was created has been cancelled. * fraudulent_transaction - Fraudulent transaction. * invoice_written_off - The invoice has been completely written off. Orders are generated by Chargebee in cancelled state. * product_not_required - Product not required. * payment_declined - Payment declined. * product_not_available - Product not available. * third_party_cancellation - Third party cancellation.

Possible values:

  • "invoice_voided"
  • "product_unsatisfactory"
  • "invoice_written_off"
  • "delivery_date_missed"
  • "subscription_cancelled"
  • "third_party_cancellation"
  • "others"
  • "product_not_available"
  • "product_not_required"
  • "fraudulent_transaction"
  • "shipping_cut_off_passed"
  • "order_resent"
  • "alternative_found"
  • "payment_declined"
order_date Integer Yes

The date on which the order will start getting processed.

created_at Integer Yes

The time at which the order was created.

subscription_id String No

The subscription for which the order is created.

billing_address Object No

Parameters for billing_address

billing_address.first_name String No

The first name of the billing contact.

billing_address.state String No

The state/province name. Is set by Chargebee automatically for US, Canada and India If state_code is provided.

billing_address.city String No

The name of the city.

billing_address.validation_status String No

The address verification status. * valid - Address was validated successfully. * partially_valid - The address is valid for taxability but has not been validated for shipping. * invalid - Address is invalid. * not_validated - Address is not yet validated.

Possible values:

  • "partially_valid"
  • "valid"
  • "not_validated"
  • "invalid"

Default value: "not_validated"

billing_address.line2 String No

Address line 2

billing_address.line1 String No

Address line 1

billing_address.email String No

The email address.

billing_address.last_name String No

The last name of the billing contact.

billing_address.company String No

The company name.

billing_address.line3 String No

Address line 3

billing_address.state_code String No

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.zip String No

Zip or postal code. The number of characters is validated according to the rules specified here.

billing_address.phone String No

The phone number.

billing_address.country String No

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.

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.