Jake Posted April 15, 2020 Report Share Posted April 15, 2020 I have a two part question. First, I'm trying to figure out the workflow for creating a service from invoice. My current workflow in my app is the following: Create user -> add Credit card data -> create a service -> create the invoice -> pay the invoice with the save CC data ->update the service to active. My question is if I create a service will the system automatically create an invoice when the CRON is run or should I do it through the API. The way I am currently doing it seems like a lot of calls and I would prefer to lower the amount of calls I am making. Is there a better way? Secondly I am trying to create an invoice from a service but it is giving me an error $BlestaCreateData = array( 'client_id' => 23, 'services_ids' => array(26), 'currency' => 'USD', 'due_date' => date("c"), 'allow_pro_rata' => false, 'services_renew' => true, ); $response = $this->blestaapi->post('invoices', 'createFromServices', $BlestaCreateData); echo '<pre>'; $RetVal = $response; print_r($response->response()); print_r($response->errors()); The error is Class Object ( [error] => stdClass Object ( [message] => An unexpected error occured. [response] => Internal error: Failed to retrieve the default value ) ) What am I missing? Quote Link to comment Share on other sites More sharing options...
Jono Posted April 15, 2020 Report Share Posted April 15, 2020 The answer to you first question is no, the cron will not automatically invoice created services, though it does automatically invoice renewing service. For your second question, it is trying to default the service_ids parameter since you have accidentally written services_ids. Quote Link to comment Share on other sites More sharing options...
Jake Posted April 16, 2020 Author Report Share Posted April 16, 2020 OK...I updated that but now it gives me the following error: [lines[0][description]] => stdClass Object ( [empty] => Please enter a line item description. ) The documentation does not show that I need to provide that information. How am I supposed to add that info? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.