D7 Rules - Unable to get data value & Unable to evaluate action in custom module I am working on a module that gets the order data upon commerce checkout completion and sends it to an api elsewhere for processing. In testing, everything was working fine until I called my method from my rule, which led me here. 

I am wondering if my inexperience with Drupal has caused me to make an error in defining my rule. Any additional information that can point me in the appropriate direction is always welcome.

I have researched this topic rather intensely and did not find any solid remedy, please don't assume I have not searched. I assure you I have, I have been stuck on this issue for 4 days now :/  Thanks in advance.

Here is my rule:

function my_module_rules_action_info() {
  $actions = array();
  $actions['my_module_sync_inventory'] = array(
    'label' =&gt; t('Sync inventory'),
    'callbacks' =&gt; array(
      'execute' =&gt; 'my_module_rules_sync_inventory'
    )
  );
  return $actions;
}


and here are the defaults:

function my_module_default_rules_configuration() {
  $rules = array();
  $rule = rules_reaction_rule();
  $rule-&gt;label = t('Sync Inventory on Checkout');
  $rule-&gt;tags  = array('Commerce Cart', 'Commerce', 'Inventory', 'Sync');
  $rule-&gt;weight = 20;
  $rule-&gt;active = TRUE;
  $rule
    -&gt;event('commerce_checkout_complete')
    -&gt;action('my_module_sync_inventory');
  $rules['my_module_sync_inventory'] = $rule;
  return $rules;
}


this is the callback

function my_module_rules_sync_inventory() {
  global $user;
  $data = commerce_cart_order_load($user-&gt;uid);
  // ... process data
}
For any future readers who encounter this issue:

It turns out the answer all along was using the hook_commerce_checkout_complete in my module, rather than trying to insert an action with rules.

Here is an example I used for debugging:

function MYMODULE_commerce_checkout_complete($order){
  $file = fopen("checkout_debug.json", "w") or die("Unable to open file!");
  fwrite($file, json_encode($order, JSON_PRETTY_PRINT));
}


of course the reason I used json_encode is because $order is not a string and I could pretty print it.

Hope it helps someone, eventually. Thanks again.