2017 © Pedro Peláez
 

library priceva-api-php

image

sinbadxiii/priceva-api-php

  • Friday, July 6, 2018
  • by sinbadxiii
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Priceva API PHP

Public API Priceva - Competitor Monitoring Price Tracking Solution https://priceva.com., (*1)

Getting Started

Requirements

To use this component, you need at least: - Composer - PHP >= 5.5, (*2)

NOTE: Support for legacy PHP versions (down to 7.0) is provided on a best-effort basis., (*3)

Installing

Composer

$ php composer require sinbadxiii/priceva-api-php

or create the composer.json file as follows:, (*4)

{
    "require": {
        "sinbadxiii/priceva-api-php": "dev-master"
    }
}

Use

$api = new PricevaApi(['apiKey' => 'xxxxxxxxxxxxxx']);

//check access api
$api->ping()

//get all products
$api->productList();

//get one product
$api->getProduct($codeProduct);

//get all report
$api->reportList();

If you want to use a filter, you can set the condition in two ways., (*5)

The first way is to create an array with filter fields and pass it to the method, for example:, (*6)

$api = new PricevaApi(['apiKey' => 'xxxxxxxxxxxxxx']);

$filter = [
    'limit' => 10,
    'brand_id' => 't'
];

$api->productList($filter);
...
$api->reportList($filter);

fields for the filter, (*7)

$filter = [
    'page'        => 1;
    'limit'       => 100;
    'category_id' => [];
    'brand_id'    => [];
    'company_id'  => "";
    'region_id'   => "";
    'active'      => 1;
    'name'        => "";
    'articul'     => "";
    'client_code' => [];
];

The second way is to query using the filter constructor createFilter():, (*8)

$api = new PricevaApi(['apiKey' => 'xxxxxxxxxxxxxx']);

$result = $api->createFilter()
              ->setLimit(10)
              ->setPage(2)
              ->setCompany('b')
              ->execute()         //the required method for assembling the filter
              ->productList();

...

$result = $api->createFilter()
              ->setLimit(10)
              ->setPage(2)
              ->setCompany('b')
              ->execute()         
              ->reportList();              

Constructor methods:, (*9)

  • setPage($page);
  • setLimit($limit);
  • setCategory($category_id);
  • setBrand($brand_id);
  • setCompany($company_id);
  • setRegion($region_id);
  • setActive($active);
  • setName($name);
  • setSku($sku);
  • setCodeProduct($client_code);

The Versions

06/07 2018

dev-master

9999999-dev

  Sources   Download

The Requires

  • php >=5.5

 

06/07 2018

dev-dev

dev-dev

  Sources   Download

The Requires

  • php >=5.5