Title: Woocomerce API internal server error when adding order
Last modified: February 10, 2021

---

# Woocomerce API internal server error when adding order

 *  Resolved [lyoncapsdev](https://wordpress.org/support/users/lyoncapsdev/)
 * (@lyoncapsdev)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/woocomerce-api-internal-server-error-when-adding-order/)
 * Hello,
    I am developing a online store with React-Native, which allows customers
   to purchase products. I am using the woocomerce API, a WordPress plugin.
 * When I try to create an order from the API, it gives me an internal server error.
 * Here is my API call to create an order :
 *     ```
       const data = {
               payment_method: "mollie_wc_gateway_creditcard",
               payment_method_title: "Mollie - Carte de crédit",
               set_paid: false,
               billing: {
                 first_name: "John",
                 last_name: "Doe",
                 address_1: "1 rue des champs",
                 address_2: "",
                 city: "Paris",
                 state: "FR",
                 postcode: "75000",
                 country: "FR",
                 email: "john.doe@example.com",
                 phone: "0636......"
               },
               shipping: {
                   first_name: "John",
                   last_name: "Doe",
                   address_1: "1 rue des champs",
                   address_2: "",
                   city: "Paris",
                   state: "FR",
                   postcode: "75000",
                   country: "FR",
                   email: "john.doe@example.com",
                   phone: "0636......"
               },
               line_items: [
                 {
                   product_id: 3884,
                   quantity: 2
                 },
                 {
                   product_id: 3198,
                   variation_id: 3375,
                   quantity: 1
                 }
               ],
               shipping_lines: [
                 {
                   method_id: "lpc_sign",
                   method_title: "Colissimo avec signature",
                   total: "6.70"
                 }
               ]
             };
   
           return await api.post('orders', data).then((response)=>response);
       ```
   
 * I want to create an order with two products and with “Colisimo avec signature”
   delivery method.
 * And here is the response :
 *     ```
       {
          "additional_errors": [], 
          "code": "internal_server_error", 
          "data": {
             "status": 500
          }, 
          "message": "<p>There was a critical error on this site.</p><p><a 
                      href=\"https://fr.wordpress.org/support/article/debugging-in-wordpress/\">Learn
                      more on debugging WordPress.</a></p>"
       }
       ```
   
 * I checked in the woocommerce logs and found this error :
 *     ```
       2021-02-09T01:21:04-08:00 CRITICAL Uncaught Error: Call to a member function __isset() on null in /homepages/17/d837071568/htdocs/clickandbuilds/LyoncapsEcommerce/wp-content/plugins/tshirtecommerce/tshirtecommerce.php:1114
       Stack trace:
       #0 /homepages/17/d837071568/htdocs/clickandbuilds/LyoncapsEcommerce/wp-includes/class-wp-hook.php(287): tshirt_order_meta_handler(64, NULL, NULL)
       #1 /homepages/17/d837071568/htdocs/clickandbuilds/LyoncapsEcommerce/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters('', Array)
       #2 /homepages/17/d837071568/htdocs/clickandbuilds/LyoncapsEcommerce/wp-includes/plugin.php(484): WP_Hook->do_action(Array)
       #3 /homepages/17/d837071568/htdocs/clickandbuilds/LyoncapsEcommerce/wp-content/plugins/woocommerce/includes/class-wc-deprecated-action-hooks.php(159): do_action('woocommerce_add...', 64, NULL, NULL)
       #4 /homepages/17/d837071568/htdocs/clickandbuilds/LyoncapsEcommerce/wp-content/plugins/woocommerce/includes/class-wc-deprecated-action-hooks.php(107): WC_Deprecated_Action_Hooks->trigger_hook('woocommerce_add...', Arr dans /homepages/17/d837071568/htdocs/clickandbuilds/LyoncapsEcommerce/wp-content/plugins/tshirtecommerce/tshirtecommerce.php at line 1114
       ```
   
 * Note that the order has been created but informations such as the 2nd product
   and the delivery method are missing.
 * [Order screenshot](https://i.stack.imgur.com/hyL1f.png)
 * Sorry but it’s in french. Im french, so sorry for my english ^^
 * I noticed that the products with variations (color, size …) are missing. Even
   if I don’t choose a product with variations, I get the same error.
 * I don’t know how to fix this problem.
 * Thank you in advance for your help !

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

 *  Plugin Support [Riaan K.](https://wordpress.org/support/users/riaanknoetze/)
 * (@riaanknoetze)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/woocomerce-api-internal-server-error-when-adding-order/#post-14031235)
 * Hi there,
 * This is a fairly complex development topic. I’m going to leave it open for a 
   bit to see if anyone is able to chime in to help you out.
 * I can also recommend [the WooCommerce Developer Resources Portal](https://developer.woocommerce.com/)
   for resources on developing for WooCommerce.
 * You can also visit the [WooCommerce Facebook group](https://www.facebook.com/groups/advanced.woocommerce/)
   or the `#developers` channel of the [WooCommerce Community Slack](https://woocommerce.com/community-slack/).
   We’re lucky to have a great community of open-source developers for WooCommerce,
   and many of our developers hang out there, as well.
 *  Plugin Support [Gabriel – a11n](https://wordpress.org/support/users/gabrielfuentes/)
 * (@gabrielfuentes)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/woocomerce-api-internal-server-error-when-adding-order/#post-14093445)
 * We’ve not seen any activity on this thread for a while, so I’m marking this thread
   as resolved.
 * Hopefully, you were able to find a solution to your problem! If you have further
   questions, please feel free to open a new topic.
 * Cheers!

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

The topic ‘Woocomerce API internal server error when adding order’ is closed to 
new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

 * ["internal server error"](https://wordpress.org/support/topic-tag/internal-server-error/)
 * [api](https://wordpress.org/support/topic-tag/api/)
 * [order](https://wordpress.org/support/topic-tag/order/)
 * [rest](https://wordpress.org/support/topic-tag/rest/)
 * [woocomerce](https://wordpress.org/support/topic-tag/woocomerce/)

 * 2 replies
 * 3 participants
 * Last reply from: [Gabriel – a11n](https://wordpress.org/support/users/gabrielfuentes/)
 * Last activity: [5 years, 2 months ago](https://wordpress.org/support/topic/woocomerce-api-internal-server-error-when-adding-order/#post-14093445)
 * Status: resolved