Title: Orders synchronization error &#8211; id: cannot be empty
Last modified: May 18, 2023

---

# Orders synchronization error – id: cannot be empty

 *  Resolved [Pavlo Kr.](https://wordpress.org/support/users/pavlok/)
 * (@pavlok)
 * [3 years ago](https://wordpress.org/support/topic/orders-synchronization-error-id-cannot-be-empty/)
 * When I try to sync orders I get an error:
   `ERROR order_submit.error :: addStoreOrder::#
   3695275 :: Error Code 400 ::id: cannot be emptyon 2438 in wp-content/plugins/
   mailchimp-for-woocommerce/includes/api/class-mailchimp-api.phpThe problem is 
   in line items:[lines] => Array([0] => Array([id] => 0[product_id] => 18853[product_variant_id]
   => 18853[quantity] => 1[price] => 404.33)The id of line item can’t be “0”
 * To solve this error I edited the file
   `wp-content/plugins/mailchimp-for-woocommerce/
   includes/api/class-mailchimp-woocommerce-transform-orders-wc3.php`And on line
   188 I replaced`$item = $this->transformLineItem( $key, $order_detail );`with`
   $lineItemKey = $key + 1;``$item = $this->transformLineItem( $lineItemKey, $order_detail);`
    -  This topic was modified 3 years ago by [Pavlo Kr.](https://wordpress.org/support/users/pavlok/).

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Support [khungate](https://wordpress.org/support/users/khungate/)
 * (@khungate)
 * [3 years ago](https://wordpress.org/support/topic/orders-synchronization-error-id-cannot-be-empty/#post-16801859)
 * Hello [@pavlok](https://wordpress.org/support/users/pavlok/), I’ve noticed the
   issue you’re facing and I think you’ve pinpointed the problem correctly where
   the id of a line item cannot be zero during orders synchronization. Your manual
   adjustment to the `class-mailchimp-woocommerce-transform-orders-wc3.php` file
   is a good temporary fix.
   To address this, you can also incorporate the following
   code snippet:`function modify_line_item_key($key, $order) {$key = $key + 1;return
   $key;}add_filter('mailchimp_line_item_key', 'modify_line_item_key', 10, 2);This
   will effectively increment the line item key, similar to your manual adjustment.
   Also, we are planning to include a fix for this issue in our next plugin update
   to prevent this problem from occurring in the future.We appreciate your communication
   on this matter, and thank you for bringing this to our attention!
 *  Plugin Support [khungate](https://wordpress.org/support/users/khungate/)
 * (@khungate)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/orders-synchronization-error-id-cannot-be-empty/#post-16842983)
 * Hi [@pavlok](https://wordpress.org/support/users/pavlok/), we’re going to close
   out this ticket for now since it’s been a few weeks since we’ve been in touch.
 * Please let us know if you still need any help and we’ll be glad to reopen and
   troubleshoot further. Please note, that the best way to reach us is over at the
   GitHub plugin page: [https://github.com/mailchimp/mc-woocommerce/](https://github.com/mailchimp/mc-woocommerce/).
   From there, you can receive direct responses from the development team, log new
   issues, download the latest version, and track existing support tickets.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Orders synchronization error – id: cannot be empty’ is closed to new 
replies.

 * ![](https://ps.w.org/mailchimp-for-woocommerce/assets/icon-256x256.png?rev=1509501)
 * [Mailchimp for WooCommerce](https://wordpress.org/plugins/mailchimp-for-woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mailchimp-for-woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mailchimp-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/mailchimp-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mailchimp-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mailchimp-for-woocommerce/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [khungate](https://wordpress.org/support/users/khungate/)
 * Last activity: [2 years, 11 months ago](https://wordpress.org/support/topic/orders-synchronization-error-id-cannot-be-empty/#post-16842983)
 * Status: resolved