Download the PHP package webtize/erply-php-sdk without Composer

On this page you can find all versions of the php package webtize/erply-php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package erply-php-sdk

erply-php-sdk

Import Library into project

You can use

"composer require webtize/erply-php-sdk"

Add into Composer.json file in project

  "repositories": [
          {
              "type": "vcs",
              "url": "https://github.com/webtize/erply-php-sdk"
          }
      ]
  "require": {
          "webtize/erply-php-sdk": "^1.0"
      }

  In terminal execute command "composer update"

How to Use Library

Creating Instance for one account with eviroment variables

Set up .env file
Add 

ERPLY_CLIENTID=######
ERPLY_USER = ######
ERPLY_PASS = ######

into you .env file of project
gettting Instance
$erply = ErplyAPI::getErplyInstance();
$pim = PIMAPI::getPIMInstance();
$reportApi = ReportAPI::getReportInstance();

Creating Instance for multiple account without eviroment variables

$erply = ErplyAPI::getErplyInstance2($code, $username, $password);
$pim = PIMAPI::getPIMInstance2($code, $username, $password);
$reportAPI = ReportAPI::getReportInstance2($code, $username, $password);

Examples Fetching data from Erply

    ### Product Group Ids ###
        $response = $erply->getProductGroups(['recordsOnPage' => 100, 'pageNo' => $currentPage]);
        if ($response->getStatus()->getResponseStatus() == 'ok') {
            foreach ($response->getRecords() as $record) {
                $this->saveIds($record->getProductGroupID(), $record->getName(), 'group');
            }
    ### Customer Group Ids ###
        $response = $erply->getCustomerGroups(['recordsOnPage' => 100, 'pageNo' => $currentPage]);
        if ($response->getStatus()->getResponseStatus() == 'ok') {
            foreach ($response->getRecords() as $record) {
                $this->saveIds($record->getCustomerGroupID(), $record->getName(), 'cgroup');
            }
    ### Suppplier ###
        $response = $erply->getSuppliers(['recordsOnPage' => 100, 'pageNo' => $currentPage]);
        if ($response->getStatus()->getResponseStatus() == 'ok') {
            foreach ($response->getRecords() as $record) {
                $name = $record->getCompanyName();
                if ($name == null) {
                    $name = $record->getFullName();
                }
    ####Brands####
        $response = $erply->getBrands(['recordsOnPage' => 100, 'pageNo' => $currentPage]);
        if ($response->getStatus()->getResponseStatus() == 'ok') {
            foreach ($response->getRecords() as $record) {
                $this->saveIds($record->getBrandID(), $record->getName());
            }
    ####Dimentions#####
        $response = $erply->getMatrixDimensions(['recordsOnPage' => 100, 'pageNo' => $currentPage]);
        if ($response->getStatus()->getResponseStatus() == 'ok') {
            foreach ($response->getRecords() as $record) {
                foreach ($record->getVariations() as $variation) {
                    $this->saveDIds($record->getDimensionID(), $variation->getCode(), 'dimension', $variation->getVariationID());
                }
             }
         }

Example Saving data on Erply

$arr_customers = [];
    foreach ($this->customers as $person) {
        $customer = new Customer();
        $customer->setGroupID($person->CUSTOMERGROUP);
        $customer->setIntegrationCode($person->CUSTOMERCODE);
        $customer->setFullName($person->CUSTOMERNAME);
        $customer->setEmail($person->EMAIL);
        $customer->setPhone($person->PHONE1);
        $customer->setJobTitleID($person->CONTACTPERSONPOSITION);
        $customer->setPaymentDays($person->PAYMENTTERMS);
        $customer->setVatNumber($person->ABNNO);
        $customer->setCountryID($person->BILLCOUNTRY);
        $customer->setRequestID($person->CUSTOMERCODE);
        array_push($arr_customers, $customer);
    }

    $customers = new Customers();
    $customers->setRecords($arr_customers);

    $response = $this->erply->saveCustomers($customers);

    if ($response->getStatus()->getResponseStatus() == 'ok') {
        foreach ($response->getRequests() as $request) {
            if ($request->getStatus()->getResponseStatus() == 'ok') {
                print_r($request->getRecords());
            }
        }
    }

Fetching Data in Bulk from Erply

  $arr_payments_query = [];  
  foreach ($this->getDocs() as $doc) {
      array_push($arr_payments_query, ['requestID' => $doc->getId(), 'documentID' => $doc->getId()]);
    }

    $response = $this->erply->getPaymentsBulk($arr_payments_query);
    if ($response->getStatus()->getResponseStatus() == 'ok') {
        foreach ($response->getRequests() as $request) {
            if ($request->getStatus()->getResponseStatus() == 'ok') {
                foreach ($request->getRecords() as $record) {
                    print_r($record);
                }
            }
        }
    }

YOU CAN MAKE YOUR OWN QUERIES and SEnd FROM

      $erply->getSingleData([
        'request'=>''
      ]);
      $erply->getBulkData([
        ['requestName'=>''],
        ['requestName'=>''],
        ['requestName'=>'']
      ]);

All versions of erply-php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
guzzlehttp/guzzle Version >=7.3
ext-curl Version *
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package webtize/erply-php-sdk contains the following files

Loading the files please wait ....