Why are my orders not being imported?

If your order remains on the status ' New' in ChannelEngine, this will always certainly mean that your webshop or other order management system has not yet successfully retrieved the order from our system. The reason for this can vary depending on your system / connection, but in almost all cases you should be able to find the root cause yourself.

If an order is 'acknowledged' by your order management service, the status of the order will switch to ' In progress' and a "Merchant Order No" will be visible in ChannelEngine. This number is the unique reference numbers in your own order management, for example Magento or Prestashop orderId or the unique order number your ERP uses. By looking up that number in your own system, you should be able to find the order in question.

The most common causes are that one or more of the ordered products are not available or unknown, one or more of the order fields contain information that the system does not accept (like a housenumber addition that is too long) or that the order connection is somehow disabled. Below are listed a few common errors per system and how the root cause for issues with importing orders can found.

Magento 1

In case of Magento 1 during the installation 3 'cronjobs' will be installed into Magento. 1 of these (ce_import_orders) is responsible for calling our API for new orders. 

If your orders are not being imported in Magento, first check if your cronjobs are enabled. You can manually trigger the script the cronjob executes by pressing the ' Manually import orders' button in the configuration settings of our plugin (System > ChannelEngine > Settings > Manually import orders).

Here you also have the option to manually call the other 2 cronjobs: import returns and generating a product feed.

If pressing 'Manually imports orders' gives a green button as feedback, this means the task has been successfully executed (and this in turn usually means orders have been imported - however this is purely a check if the task was successful, not if orders have been retrieved). If the button turns red, one or more errors have occurred. 

If the button turned red or the orders are still not imported, you can download the 'Log' to download the error-log. This log will contain the Magento exceptions including the stack trace, so it can look a little intimidating if you have had no previous experience with such errors. Scroll down to the bottom for the newest error. Please note: Magento errors are very cryptic and short, so if it's unclear what a specific error means, please let us know.

Below is a example of such an error message + stacktrace:

	--------------------
	2018-10-22T13:10:53+00:00 ERR (3): exception 'InvalidArgumentException' with message 'invalid length for $phone when calling MerchantOrderResponse., must be smaller than or equal to 20.' in /data/web/public/lib/ChannelEngine/vendor/channelengine/api-client-php/lib/Model/MerchantOrderResponse.php:509

	Stack trace:
	#0 /data/web/public/lib/ChannelEngine/vendor/channelengine/api-client-php/lib/ObjectSerializer.php(291): ChannelEngine\ApiClient\Model\MerchantOrderResponse->setPhone('\xE2\x80\xAD+44 7464 957...')
	#1 /data/web/public/lib/ChannelEngine/vendor/channelengine/api-client-php/lib/ObjectSerializer.php(236): ChannelEngine\ApiClient\ObjectSerializer::deserialize(Object(stdClass), '\\ChannelEngine\\...', NULL)
	#2 /data/web/public/lib/ChannelEngine/vendor/channelengine/api-client-php/lib/ObjectSerializer.php(291): ChannelEngine\ApiClient\ObjectSerializer::deserialize(Array, '\\ChannelEngine\\...', NULL)
	#3 /data/web/public/lib/ChannelEngine/vendor/channelengine/api-client-php/lib/Api/OrderApi.php(347): ChannelEngine\ApiClient\ObjectSerializer::deserialize(Object(stdClass), '\\ChannelEngine\\...', Array)
	#4 /data/web/public/lib/ChannelEngine/vendor/channelengine/api-client-php/lib/Api/OrderApi.php(294): ChannelEngine\ApiClient\Api\OrderApi->orderGetNewWithHttpInfo()
	#5 /data/web/public/app/code/community/Tritac/ChannelEngine/Model/Observer.php(147): ChannelEngine\ApiClient\Api\OrderApi->orderGetNew()
	#6 /data/web/public/app/code/community/Tritac/ChannelEngine/controllers/Adminhtml/CeController.php(23): Tritac_ChannelEngine_Model_Observer->fetchNewOrders()
	#7 /data/web/public/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Tritac_ChannelEngine_Adminhtml_CeController->ordersAction()
	#8 /data/web/public/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('orders')
	#9 /data/web/public/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
	#10 /data/web/public/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
	#11 /data/web/public/app/Mage.php(684): Mage_Core_Model_App->run(Array)
	#12 /data/web/public/index.php(83): Mage::run('en', 'store')
	#13 {main}
	--------------------

In this case some submitted a phone number which contained more than 20 characters, which Magento could not handle (usually a phone number containing spaces). This could be resolved by clicking the pencil in the order information in ChannelEngine and removing the unnecessary white spaces.

The most common Magento (1) errors causing the orders to not be imported + a possible solution:

  • Cronjobs are disabled --> Enable cronjobs or run the task manually.
  • The product that was sold is (now) unavailable / out of stock --> Cancel this order in ChannelEngine and verify the stock / availability there.
  • The address information can not be parsed properly (usually fields containing data which is longer than the restriction in Magento) --> Some fields can be manually altered in ChannelEngine to fix this. Otherwise please contact our support team.
  • The 'region / state' requirement is enabled for specific countries. Almost no marketplace will submit this information, thus this field will almost always be lacking. --> Disable this requirement. A guide / tip on how to disable this can be found here.
  • The product is sold in a country that is disabled in Magento. This can happen if you for example haven't excluded countries in your Amazon shipping templates --> Either enable these countries in Magento or make sure the countries you sell to are correctly configured for each marketplace.

Warning: in some rare cases orders can still get the status "In progress" while not showing up in Magento's order grid. In that case there usually is a different plugin breaking into the web hook we use for submitting the order, thus responding with a semi random MerchantOrderNo. If this happens please contact us to verify, but unfortunately these cases are next to impossible for us to resolve and will usually have to be looked at by however maintains your website / your developer.

Magento 2

In case of Magento 2 we fully use Magento's own API. By using this API we ensure that updates from the side of Magento usually do not cause problems that require a lot of changes in our plugin, but it does limit the available options in terms of what we can submit or retrieve from Magento.

We call Magento's API (by default every 5 minutes) to create a guest cart and submit the order. If this fails, we will get a response through the API which will be stored on our end which can be seen in the notifications option in ChannelEngine. 

In the above example the product in the order is no longer available in Magento (this can either be because it is disabled or because the stock is now on 0 and backorders are not allowed).

Magento 2 uses almost exactly the same validation as Magento 1 for orders, so many of the common reasons for orders not being imported are identical:

  • The task for calling the Magento API is disabled or fails. This can be checked in ChannelEngine > Settings > Scheduled Tasks. --> Contact our support department to verify and resolve.
  • The product that was sold is (now) unavailable / out of stock --> Cancel this order in ChannelEngine and verify the stock / availability there.
  • The address information can not be parsed properly (usually fields containing data which is longer than the restriction in Magento) --> Some fields can be manually altered in ChannelEngine to fix this. Otherwise please contact our support team.
  • The 'region / state' requirement is enabled for specific countries. Almost no marketplace will submit this information, thus this field will almost always be lacking. --> Disable this requirement. A guide / tip on how to disable this can be found here.
  • The product is sold in a country that is disabled in Magento. This can happen if you for example haven't excluded countries in your Amazon shipping templates --> Either enable these countries in Magento or make sure the countries you sell to are correctly configured for each marketplace.

WooCommerce

In case of Woocommerce we make use of 'web hooks' which in turn call our (order) API again. This is why it is very important that the correct 'callback URL' as described in the Woocommerce guide, is set in ChannelEngine. Without a proper callback-URL we can't notify Woocommerce and orders will never be retrieved.

There is currently no built in logging for Woocommerce errors, so there is no easy way to discover the root cause. The most common Woocommerce errors causing the orders to not be imported + a possible solution:

  • The task for calling the Woocommerce callback URL is disabled or fails. This can be checked in ChannelEngine > Settings > Scheduled Tasks. --> Contact our support department to verify and resolve.
  • The task for calling the Woocommerce callback URL is successful, but still no orders are retrieved. This is usually caused by caching such as Varnish being applied to the callback, giving a response but not activating the webhook. --> Please exclude all relevant endpoints / directories for ChannelEngine from your caching service.
  • The product that was sold is (now) unavailable / out of stock --> Cancel this order in ChannelEngine and verify the stock / availability there.
  • The address or buyer information can not be parsed properly (usually fields containing data which is longer than the restriction of the field in WordPress) --> Some fields can be manually altered in ChannelEngine to fix this. Otherwise please contact our support team.

Prestashop

In case of Prestashop we also use a 'web hook' which in turn calls our (order) API. This is why it is very important that the correct 'callback URL' as described in the Prestashop guide, is set in ChannelEngine. Without a proper callback-URL we can't notify Prestashop and orders will never be retrieved.

Once orders are retrieved each order will be processed by creating a guest-cart and submitted to all the default validation rules Prestashop uses (in a similar fashion as Magento). If an order is not accepted by Prestashop, it is unfortunately pretty hard to discover the exact reason. This is because Prestashop by default does not log these errors and returns a generic 500 error. More information on how to enable logging can be found on Prestashops website. Also, by running the export manually and logging the http(s) calls, our support team can usually discover some more information in regard to the cause of the issue.

The most common Prestashop errors causing the orders to not be imported + a possible solution:

  • The task for calling the Prestashop webhook is disabled or fails. This can be checked in ChannelEngine > Settings > Scheduled Tasks. --> Contact our support department to verify and resolve.
  • The product that was sold is (now) unavailable / out of stock --> Cancel this order in ChannelEngine and verify the stock / availability there.
  • The address or buyer information can not be parsed properly (usually fields containing data which is longer than the restriction in Prestashop) --> Some fields can be manually altered in ChannelEngine to fix this. Otherwise please contact our support team.

API

In case of an order connection via our API your (order) system will usually do a regular call to GET /v2/orders/new to get all orders still having the status 'New'. 

The most common API errors causing the orders to not be imported + a possible solution:

  • The system which implemented our API is not performing the call --> Please contact your developer to check if this is the case and for possible error messages.
  • The system using our API is retrieving the orders, but is not acknowledging them (via POST /v2/orders/acknowledge) with a MerchantOrderNo so the order remains 'New' on our end. This might cause orders to be continuously imported which is also not a good thing --> Please contact your developer to check if this is the case and for possible error messages.
  • The address or customer information can not be parsed properly (usually fields containing data which is longer than the restriction in your order management system) --> Some fields can be manually altered in ChannelEngine to fix this. Otherwise please contact our support team.

Because the implementation of our API in your own system is completely outside our sphere of influence, problems will usually have to be solved by a developer or whoever implemented our API. In case of API errors we do log a short error message, but the system communicating with our services through the API will always have the original API call and API error to debug issues.

Custom plugin / connection

In case of a custom build plugin / connection (such as Unit4 or Exact) orders are usually exported from ChannelEngine through the means of a SOAP connection. Usually successfully submitting orders to such a system require the inclusion of a lot of extra information (such as a debit number and other settings) which can be configured in ChannelEngine.

  • The task for submitting orders is disabled or fails. This can be checked in ChannelEngine > Settings > Scheduled Tasks. --> Contact our support department to verify and resolve the issue.
  • Specific settings for your plugin are missing or incorrect. While some verification is applied when initially setting up the plugin, information missing for a new channel can always cause errors --> Check the settings in ChannelEngine under 'Setup'. Otherwise please contact our support team.
  • The address or customer information can not be parsed properly (usually fields containing data which is longer than the restriction in your system) --> Some fields can be manually altered in ChannelEngine to fix this. Otherwise please contact our support team.