henzard
2/19/2015 - 7:09 AM

addAccounts

 function addAccounts($Account) {
        $Account->HasErrors();
        $xml = $Account->printAccount();
        $response = $this->token->XeroOAuth->request('PUT', $this->token->XeroOAuth->url('Accounts', 'core'), array(), $xml);

        if ($this->token->XeroOAuth->response['code'] == 200) {
            $accounts = $this->token->XeroOAuth->parseResponse($this->token->XeroOAuth->response['response'], $this->token->XeroOAuth->response['format']);
            return $accounts->Accounts;
        } else {
            $this->token->outputError($response);
            return $response;
        }
    }