diff --git a/src/Factory/Invoice.php b/src/Factory/Invoice.php
index <HASH>..<HASH> 100644
--- a/src/Factory/Invoice.php
+++ b/src/Factory/Invoice.php
@@ -506,6 +506,9 @@ class Invoice
         } elseif ($mKey instanceof \stdClass) {
             $this->oCallbackData = new CallbackData($mKey);
         } else {
+            if ($this->oCallbackData === null) {
+                $this->oCallbackData = new \stdClass();
+            }
             $this->oCallbackData->{$mKey} = $mValue;
         }
 
diff --git a/src/Factory/Invoice/Item.php b/src/Factory/Invoice/Item.php
index <HASH>..<HASH> 100644
--- a/src/Factory/Invoice/Item.php
+++ b/src/Factory/Invoice/Item.php
@@ -289,6 +289,9 @@ class Item
         } elseif ($mKey instanceof \stdClass) {
             $this->oCallbackData = new CallbackData($mKey);
         } else {
+            if ($this->oCallbackData === null) {
+                $this->oCallbackData = new \stdClass();
+            }
             $this->oCallbackData->{$mKey} = $mValue;
         }
Prevents phpe rror when passing in key/values to invoice and invoice item factories setCallbackData methods