Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/06/2018 in all areas

  1. Hello, By default it is set to upgrade instantly, however you can change your settings so that the upgrade only takes place after invoice has been paid. To change settings, follow steps below: Go to Settings > Company > Billing/Payment > Invoice and Charge Options Scroll down and you can find this at very end: Queue Service Changes Until Paid You can tick that and save the settings to enable upgrade only after invoice is paid.
    2 points
  2. When the API doesn't work the way you expect, you should look at the errors you enconter, e.g.: print_r($response->errors()); See the docs for an example. From looking at your request, you are making a couple mistakes: You're using the "GET" HTTP verb to add something. "GET" [i.e. $api->get(..)] should only be used for retrieving information, not setting information. Use "POST" [i.e. $api->post(...)] You're not passing valid key => value pairs for all values expected by Invoices::add You have "array($service_id,'Desc', 1,1,0)". Is that supposed to be the line items? Why aren't they in key => value format? You have "...'recur_date_billed' => $today, 1)));". What is that extraneous 1 at the end of the list that is not in key => value format? It'll be easier to figure out and avoid issues if you format your source code better: $response = $api->get( "invoices", "add", array( 'vars' => array( 'client_id' => $client_id, 'date_billed' => $today, 'date_due' => $today, 'date_closed' => $today, 'date_autodebit' => $today, 'status' => 'active', 'currency' => '208', 'note_public' => 'Public note', 'note_private' => 'Privat note', array($service_id,'Desc', 1,1,0), 'period' => 'month', 'duration' => 'indefinitely', 'duration_time' => '1', 'recur_date_billed' => $today, 1 ) ) );
    1 point
×
×
  • Create New...