silici0/vtex

There is no license information available for the latest version (dev-master) of this package.

Vtex api access for PHP

dev-master 2019-04-26 19:32 UTC

This package is auto-updated.

Last update: 2022-11-18 22:44:15 UTC


README

This library provides an objected-oriented wrapper of the PHP classes to access Vtex REST api

Installation

composer require silici0/vtex:dev-master

Configuration

Create a file in your root folder called "config-vtex.json" as the follow example code :

{
  "accountName": "account-name",
  "environment": "vtexcommercestable",
  "AppKey": "vtex-appKey",
  "AppToken": "vtex-apptoken"
}

Usage example

require "vendor/autoload.php";
use silici0\Vtex\VtexService;

$v = new VtexService();
$params = array();
$params['orderBy'] = "orderId,desc";
$params['f_shippingEstimate'] = "2.days";
$repositories = $v->getOmsListOrders($params);

echo "Found " . count($repositories) . " results:\n";
foreach ($repositories as $repo) {
    echo $repo->orderId;
}