API Forum

This forum is in read-only mode.
Please refer to our API support in case you have any questions.
We can be reached at api@e-conomic.com
e-conomic API developer forum

Make a simple CashBook entry using SOAP and PHP

0

I would like to make a simple cashbook entry everytime a purcahse is made on our platform. The entry should contain:

  • Amount
  • Account number (e.g. 5820)
  • (optionally) some text

I have found a PHP Economic SOAP library and struggled with it for some hours, to then figure out that it does not seem to be able to make a cashbook entry: https://github.com/xown/economic-soap-php-client

Can someone help me out with a snippet or something that can solve this for me? I am lost...

Update:

Soldering on, I have tried to extend the CashBookService in the Economic SOAP PHP Client (https://github.com/xown/economic-soap-php-client).

I have created a new method in the model like this:


    public function createCashBookEntry(array $parameters)
    {
        $this->client->connect();
 
        try {
            $response = $this->client->CashBookEntry_CreateFromDataArray($parameters);
 
            return $response;
        } catch (\SoapFault $e) {
            throw new EconomicException($e->getMessage());
        }
    }

And then trying to call it like this:

$economicCashbook = Economic::getCashBookService();
 

$created = $economicCashbook->createCashBookEntry([
    'dataArray' => [
        'CashBookEntryData' => [
            'Handle' => [
                'id1' => '1',
                'id2' => '2',
            ]
        ]
    ]
]);

But I have no idea if this is the right direction. Especially, I think the way I provide the input parameters is wrong. Can anybody help?

 

created Jun 27, 2016 by simplenotezy
0% Accept Rate

edited Jun 28, 2016 by simplenotezy
Q 1 A 0 C 0

Visma e-conomic A/S
...