title: 500 error when trying to add new order in TradeGecko API
body: <p>Pretty specific problem, but I'll lay it out as best I can.</p>
  
  <p>I can easily make a POST request to the TradeGecko API (detailed here: <a href="http://developer.tradegecko.com/" rel="nofollow">http://developer.tradegecko.com/</a>) and get variant prices in return, that part of the interaction is working smoothly.</p>
  
  <p>However, I'm trying to create a new order and I feel like I'm missing something!</p>
  
  <p>Here's what I have:</p>
  
  <pre><code>&lt;?php
  $authorizeUrl = 'https://api.tradegecko.com/oauth/authorize';
  $accessTokenUrl = 'https://api.tradegecko.com/oauth/token';
  $clientId = &lt;MY_CLIENT_ID&gt;;
  $clientSecret = &lt;MY_CLIENT_SECRET&gt;;
  $redirectUrl = &lt;REDIRECT_URI&gt;;
  
  // https://github.com/adoy/PHP-OAuth2
  
  require("Client.php");
  require("GrantType/IGrantType.php");
  require("GrantType/AuthorizationCode.php");
  $client = new OAuth2\Client($clientId, $clientSecret, OAuth2\Client::AUTH_TYPE_AUTHORIZATION_BASIC);
  $client-&gt;setCurlOption(CURLOPT_USERAGENT,$userAgent);
  $client-&gt;setAccessToken(&lt;MY_ACCESS_TOKEN&gt;);
  $client-&gt;setAccessTokenType(OAuth2\Client::ACCESS_TOKEN_BEARER);
  $params = 
  array('order' =&gt; 
      array( 
          'company_id' =&gt; '12345',
          'shipping_address_id' =&gt; 1,
          'billing_address_id' =&gt; 1,
          'status' =&gt; 'active',
          'issued_at' =&gt; '10-04-2016',
          'order_line_items' =&gt; array(
              array('variant_id' =&gt; 123456,
                  'quantity' =&gt; 2),
              array('variant_id' =&gt; 123457,
                  'quantity' =&gt; 2)
              )
      )
  );
  
  $response = $client-&gt;fetch('https://api.tradegecko.com/orders', false, $params); 
  print_r($response);
  ?&gt;
  </code></pre>
  
  <p>I'm hoping that there's something in that code that someone else might spot, I've been staring at it for the better part of 6 hours now, and I can't figure out why this won't go through.</p>