title: How can I get the amount spent / Faceook Marketing API
body: <p>I'm working on Facebook Marketing API (v6.0) and trying to get the amount spent of each adset I have, actually I've started with Graph API explorer but I found nothing called spend and amount spent as a field, so after a while I got this trick which actually return false data , so the equation is like the following: daily_budget - budget_remaining = amount_spent , so let's assume that we have 900 - 800 = it returns 100 in my application while in business manager I got 50, here is my endpoint api</p>
  
  <pre><code>public function facebookData()
  {
      $fb = new \Facebook\Facebook([
          'app_id' =&gt; 'xxxxx',
          'app_secret' =&gt; 'xxxxxxx',
          'default_graph_version' =&gt; 'v6.0',
          //'default_access_token' =&gt; '{access-token}', // optional
        ]);        
      try {
          // Returns a `FacebookFacebookResponse` object
          $response = $fb-&gt;get(
            '/act_xxxxxx/?fields=business,adsets.limit(1000){name,budget_remaining,daily_budget}',
            'my_accesstoken'
          );
        } catch(FacebookExceptionsFacebookResponseException $e) {
          echo 'Graph return=&lt;i&gt;&lt;/i&gt;ed an error: ' . $e-&gt;getMessage();
          exit;
        } catch(FacebookExceptionsFacebookSDKException $e) {
          echo 'Facebook SDK returned an error: ' . $e-&gt;getMessage();
          exit;
        }
  
        $data = $response-&gt;getGraphObject()-&gt;getProperty('adsets');        
        try
        {         
        foreach ($data as $ad) {
           \App\FacebookAd::UpdateOrCreate([
            'ad_id' =&gt; $ad['id'],
          ],[
            'name' =&gt; $ad['name'],
            'budget_remaining' =&gt; substr($ad['budget_remaining'],0,-2),
            'daily_budget' =&gt; substr($ad['daily_budget'],0,-2),
            'total' =&gt; substr($ad['daily_budget'],0,-2) - substr($ad['budget_remaining'],0,-2), // remove last two zeros
            'account_id' =&gt; "unset",
          ]);
        }
      }
      catch(\Exception $e)
      {
        Log::error($e-&gt;getMessage());
      }
  }
  </code></pre>