title: Shopify API Add Product Collection Error
body: <p>I am using Sandeep Shetty's PHP adapter (https://github.com/sandeepshetty/shopify.php) and trying to add Collection. here is the Code:</p>
  
  <pre><code>define( 'SHOPIFY_DOMAIN', 'domain.myshopify.com');
  define( 'SHOPIFY_API_KEY', 'API KEY');
  define( 'SHOPIFY_API_PASS', 'PASS HERE');
  define( 'SHOPIFY_SECRET', 'SECRET HERE');
  
  require 'shopify/shopify.php';
  
  
  // For regular apps:
  $shopify = shopify_api_client(SHOPIFY_DOMAIN, NULL, SHOPIFY_API_KEY, SHOPIFY_API_PASS, true);
  
  // For private apps:
  // $shopify = shopify_api_client($shops_myshopify_domain, NULL, $api_key, $password, true);
  try
  {
      // Get all products
  //        $products = $shopify('GET', '/admin/products.json', array('published_status'=&gt;'published'));
  
  
      // Create a new recurring charge
      $charge = array
      (
          "custom_collection"=&gt;array
          (
              "title"=&gt;"IPods",
              "collects"=&gt;array(
                                  "product_id"=&gt;99395362
                              )
          )
      );
  
      try
      {
          // All requests accept an optional fourth parameter, that is populated with the response headers.
          $recurring_application_charge = $shopify('POST', '/admin/custom_collections.json', $charge, $response_headers);
  //            pr($response_headers);
  //            pr($recurring_application_charge);
          // API call limit helpers
          echo shopify_calls_made($response_headers); // 2
          echo shopify_calls_left($response_headers); // 298
          echo shopify_call_limit($response_headers); // 300
  
      }
      catch (ShopifyApiException $e)
      {
          pr($e);
          // If you're here, either HTTP status code was &gt;= 400 or response contained the key 'errors'
      }
  
  }
  catch (ShopifyApiException $e)
  {
  //        $err = $e-&gt;getInfo();
      pr($e);
      /* $e-&gt;getInfo() will return an array with keys:
          * method
          * path
          * params (third parameter passed to $shopify)
          * response_headers
          * response
          * shops_myshopify_domain
          * shops_token
      */
  }
  catch (ShopifyCurlException $e)
  {
      pr($e);
      // $e-&gt;getMessage() returns value of curl_errno() and $e-&gt;getCode() returns value of curl_ error()
  }
  </code></pre>
  
  <p>When I run the above Code. I am getting ShopifyApiException Error with http_status_message] => Internal Server Error [http_status_code] => 500</p>
  
  <p>Here is the Full Array Response for reference.</p>
  
  <pre><code>ShopifyApiException Object
  (
  [info:protected] =&gt; Array
      (
          [method] =&gt; POST
          [path] =&gt; /admin/custom_collections.json
          [params] =&gt; Array
              (
                  [custom_collection] =&gt; Array
                      (
                          [title] =&gt; IPods
                          [collects] =&gt; Array
                              (
                                  [product_id] =&gt; 99395362
                              )
  
                      )
  
              )
  
          [response_headers] =&gt; Array
              (
                  [http_status_message] =&gt; Internal Server Error
                  [http_status_code] =&gt; 500
                  [server] =&gt; nginx
                  [date] =&gt; Sat, 15 Sep 2012 18:56:36 GMT
                  [content-type] =&gt; application/json; charset=utf-8
                  [transfer-encoding] =&gt; chunked
                  [connection] =&gt; keep-alive
                  [status] =&gt; 500 Internal Server Error
                  [x-shopify-shop-api-call-limit] =&gt; 1/500
                  [http_x_shopify_shop_api_call_limit] =&gt; 1/500
                  [cache-control] =&gt; no-cache
                  [x-request-id] =&gt; f6fdb72b6cabf22a73207d82b8ea16d9
                  [x-ua-compatible] =&gt; IE=Edge,chrome=1
                  [set-cookie] =&gt; _secure_session_id=cf2648422369ee231220b6f1f1efdb3b; path=/; secure; HttpOnly
                  [x-runtime] =&gt; 0.047004
              )
  
          [response] =&gt; Array
              (
                  [errors] =&gt; Error
              )
  
      )
  
  [message:protected] =&gt; Internal Server Error
  [string:Exception:private] =&gt; 
  [code:protected] =&gt; 500
  [file:protected] =&gt;PATH.TO.FILE\shopify\shopify.php
  [line:protected] =&gt; 28
  [trace:Exception:private] =&gt; Array
      (
          [0] =&gt; Array
              (
                  [file] =&gt; PATH.TO.FILE\index.php
                  [line] =&gt; 44
                  [function] =&gt; {closure}
                  [args] =&gt; Array
                      (
                          [0] =&gt; POST
                          [1] =&gt; /admin/custom_collections.json
                          [2] =&gt; Array
                              (
                                  [custom_collection] =&gt; Array
                                      (
                                          [title] =&gt; IPods
                                          [collects] =&gt; Array
                                              (
                                                  [product_id] =&gt; 99395362
                                              )
  
                                      )
  
                              )
  
                          [3] =&gt; Array
                              (
                                  [http_status_message] =&gt; Internal Server Error
                                  [http_status_code] =&gt; 500
                                  [server] =&gt; nginx
                                  [date] =&gt; Sat, 15 Sep 2012 18:56:36 GMT
                                  [content-type] =&gt; application/json; charset=utf-8
                                  [transfer-encoding] =&gt; chunked
                                  [connection] =&gt; keep-alive
                                  [status] =&gt; 500 Internal Server Error
                                  [x-shopify-shop-api-call-limit] =&gt; 1/500
                                  [http_x_shopify_shop_api_call_limit] =&gt; 1/500
                                  [cache-control] =&gt; no-cache
                                  [x-request-id] =&gt; f6fdb72b6cabf22a73207d82b8ea16d9
                                  [x-ua-compatible] =&gt; IE=Edge,chrome=1
                                  [set-cookie] =&gt; _secure_session_id=cf2648422369ee231220b6f1f1efdb3b; path=/; secure; HttpOnly
                                  [x-runtime] =&gt; 0.047004
                              )
  
                      )
  
              )
  
      )
  
  [previous:Exception:private] =&gt; 
  )
  </code></pre>
  
  <p>Please guide me what I am doing wrong here: Thanks</p>