PHPackages                             brandlive/vtex-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. brandlive/vtex-api

ActiveLibrary[API Development](/categories/api)

brandlive/vtex-api
==================

Package for integration projects, API requests to Vtex.

1.0.3(1y ago)2957↓100%MITPHPPHP &gt;=8.0

Since May 5Pushed 1y ago3 watchersCompare

[ Source](https://github.com/josefo727/vtex-api)[ Packagist](https://packagist.org/packages/brandlive/vtex-api)[ RSS](/packages/brandlive-vtex-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (7)Used By (0)

VTEX API PHP/Laravel Package
============================

[](#vtex-api-phplaravel-package)

A PHP/Laravel package for interacting with the VTEX API. **Status**: Work in progress.

Installation
------------

[](#installation)

```
composer require brandlive/vtex-api
```

Quick Start
-----------

[](#quick-start)

1. **Set up your credentials**: Provide `accountName`, `environment`, `appKey`, and `appToken`.
2. **Create a client** (e.g., `OrderClient`, `CatalogClient`, etc.).
3. **Call the desired method** by passing an array with `pathParams`, `queryParams`, and/or `body`.

```
use Vtex\Order\OrderClient;
use Vtex\Exception\VtexException;

$credentials = [
    'accountName' => 'myAccount',
    'environment' => 'vtexcommercestable',
    'appKey'      => 'your-app-key',
    'appToken'    => 'your-app-token',
];

$orderClient = new OrderClient([
    'credentials' => $credentials,
]);

try {
    // Example: Retrieve an order
    $order = $orderClient->getOrder([
        'pathParams' => [
            'orderId' => 'v999999-01',
        ],
    ]);

    print_r($order);
} catch (VtexException $e) {
    echo 'Error: ' . $e->getMessage();
}
```

Argument Options
----------------

[](#argument-options)

Each client method typically accepts an **associative array** with the following optional keys:

- **`pathParams`**: Parameters that go in the URL path (e.g., `{orderId}`, `{skuId}`, etc.).
- **`queryParams`**: Parameters that go in the query string (e.g., `?page=1&per_page=15`).
- **`body`**: The JSON body for POST/PUT/PATCH requests.

Examples
--------

[](#examples)

Below are short examples using **OrderClient**, **CheckoutClient**, and other available clients.

### 1. Get an Order

[](#1-get-an-order)

```
use Vtex\Order\OrderClient;
use Vtex\Exception\VtexException;

$orderClient = new OrderClient([
    'credentials' => $credentials,
]);

try {
    $order = $orderClient->getOrder([
        'pathParams' => [
            'orderId' => 'v999999-01',
        ],
    ]);
    print_r($order);
} catch (VtexException $exception) {
    // Handle error
}
```

### 2. Retrieve Payment Transaction

[](#2-retrieve-payment-transaction)

```
$orderClient = new OrderClient([
    'credentials' => $credentials,
]);

try {
    $response = $orderClient->retrievePaymentTransaction([
        'pathParams' => [
            'orderId' => 'v999999-01',
        ],
    ]);
    print_r($response);
} catch (VtexException $exception) {
    // Handle error
}
```

### 3. Send Payment Notification

[](#3-send-payment-notification)

```
$success = true;
$orderClient = new OrderClient([
    'credentials' => $credentials,
]);

try {
    $orderClient->sendPaymentNotification([
        'pathParams' => [
            'orderId'   => 'v999999-01',
            'paymentId' => 'PAY-1234',
        ],
    ]);
} catch (VtexException $exception) {
    $success = false;
    // Handle error
}
```

### 4. Start Handling an Order

[](#4-start-handling-an-order)

```
$success = true;
$orderClient = new OrderClient([
    'credentials' => $credentials,
]);

try {
    $orderClient->startHandlingOrder([
        'pathParams' => [
            'orderId' => 'v999999-01',
        ],
    ]);
} catch (VtexException $exception) {
    $success = false;
    // Handle error
}
```

### 5. Send Invoice Notification

[](#5-send-invoice-notification)

```
$orderClient = new OrderClient([
    'credentials' => $credentials,
]);

$body = [
    "invoiceNumber" => "123456",
    "invoiceValue"  => 100000,
    "issuanceDate"  => "2023-01-01T12:00:00Z",
    "invoiceUrl" => "",
    "invoiceKey" => "",
    "trackingNumber" => "",
    "trackingUrl" => "",
    "courier" => "",
    "items" => [
        [
            "id" =>  38,
            "price" =>  50000,
            "quantity" =>  2
        ],
        // More items
    ],
];

try {
    $response = $orderClient->orderInvoiceNotification([
        'pathParams' => [
            'orderId' => 'v999999-01',
        ],
        'body' => $body,
    ]);
    print_r($response);
} catch (VtexException $exception) {
    // Handle error
}
```

### 6. Get Cart Information (CheckoutClient)

[](#6-get-cart-information-checkoutclient)

```
use Vtex\Checkout\CheckoutClient;

$checkoutClient = new CheckoutClient([
    'credentials' => $credentials,
]);

try {
    $cartInformation = $checkoutClient->getCartInformation([
        'pathParams' => [
            'orderFormId' => 'abcdef12345',
        ],
    ]);
    print_r($cartInformation);
} catch (VtexException $exception) {
    // Handle error
}
```

### 7. Create a Product (CatalogClient)

[](#7-create-a-product-catalogclient)

```
use Vtex\Catalog\CatalogClient;

$catalogClient = new CatalogClient([
    'credentials' => $credentials,
]);

try {
    $newProduct = $catalogClient->createProduct([
        'body' => [
            'Name'        => 'My Product',
            'DepartmentId' => 8,
            'RefId'       => 'SKU-123',
            'BrandId'     => 38,
            'CategoryId'  => 123,
            'IsActive'    => true,
            'Description' => 'Product description',
            'DescriptionShort' => 'Short product description',
            // Additional fields as needed by the VTEX docs
        ],
    ]);
    print_r($newProduct);
} catch (VtexException $exception) {
    // Handle error
}
```

Handling Exceptions
-------------------

[](#handling-exceptions)

All methods may throw a `VtexException` if the API request fails. Catch it to handle errors gracefully:

```
try {
    // ...some client method
} catch (VtexException $exception) {
    // Log or handle the error
    echo 'VTEX Error: ' . $exception->getMessage();
}
```

Contributing
------------

[](#contributing)

1. Fork the repo.
2. Create a new branch for your feature or bugfix.
3. Submit a pull request.

License
-------

[](#license)

[MIT](LICENSE)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance43

Moderate activity, may be stable

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~131 days

Recently: every ~163 days

Total

6

Last Release

447d ago

Major Versions

0.1.0 → 1.0.02023-05-05

### Community

Maintainers

![](https://www.gravatar.com/avatar/043c43379c101d455e78c1e52ea439610eaf5104ba448cb9099695391882ad0a?d=identicon)[josefo727](/maintainers/josefo727)

---

Top Contributors

[![josefo727](https://avatars.githubusercontent.com/u/39111029?v=4)](https://github.com/josefo727 "josefo727 (26 commits)")

---

Tags

sdkvtex

### Embed Badge

![Health badge](/badges/brandlive-vtex-api/health.svg)

```
[![Health](https://phpackages.com/badges/brandlive-vtex-api/health.svg)](https://phpackages.com/packages/brandlive-vtex-api)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[saloonphp/saloon

Build beautiful API integrations and SDKs with Saloon

2.4k9.6M467](/packages/saloonphp-saloon)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[hubspot/api-client

Hubspot API client

23414.2M16](/packages/hubspot-api-client)[php-opencloud/openstack

PHP SDK for OpenStack APIs. Supports BlockStorage, Compute, Identity, Images, Networking and Metric Gnocchi

2292.2M24](/packages/php-opencloud-openstack)[mailchimp/transactional

458.9M16](/packages/mailchimp-transactional)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
