PHPackages                             asimlqt/netsuite-rest-api-php - 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. asimlqt/netsuite-rest-api-php

ActiveLibrary[API Development](/categories/api)

asimlqt/netsuite-rest-api-php
=============================

A REST API client for Netsuite

0.6.0(1y ago)532.1k↓46.8%2[2 issues](https://github.com/asimlqt/netsuite-rest-api-php/issues)MITPHPPHP &gt;=8.1

Since May 27Pushed 1y ago2 watchersCompare

[ Source](https://github.com/asimlqt/netsuite-rest-api-php)[ Packagist](https://packagist.org/packages/asimlqt/netsuite-rest-api-php)[ RSS](/packages/asimlqt-netsuite-rest-api-php/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (6)Dependencies (7)Versions (8)Used By (0)

netsuite-rest-api-php
=====================

[](#netsuite-rest-api-php)

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1
- PSR-7, PSR-17 and PSR-18 implementations

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

[](#installation)

```
composer require asimlqt/netsuite-rest-api-php
```

Usage
-----

[](#usage)

The first step is to create a factory instance passing in the netsuite API settings. All the params are required.

```
$factory = new NetsuiteRestApi\NetsuiteClientFactory(
    $companyUrl,
    $accountId,
    $consumerKey,
    $consumerSecret,
    $tokenId,
    $tokenSecret
);
```

After that call the create method which will return an instance of the REST API client.

```
$client = $factory->create();
```

You can now call any endpoint you want on the client e.g.

```
try {
    $response = $client->customer->get('1234');
} catch (ApiException $e) {
    echo $e->getMessage();
}
```

### Error Handling

[](#error-handling)

Make sure to wrap all API calls in a `try/catch`. There is only one exception that will be thrown when an API call fails `NetsuiteRestApi\Client\ApiException`

To get the actual response object simply call the `getResponse()` method of the exception instance. This will return a `Psr\Http\Message\ResponseInterface`.

### API methods available

[](#api-methods-available)

Every endpoint has the following 6 methods:

- list
- get
- insert
- delete
- update
- upsert

Note: not all of these are available for every endpoint in Netsuite. For the time being this client does not prevent you from calling unavailable methods, however, you will receive an error from Netsuite.

### Pagination

[](#pagination)

The only endpoint that supports pagination is `list`. This will return a cursor that implements `Iterator` so you can iterate over it as you would normally.

```
try {
    $cursor = $client->currency->list();
    foreach ($cursor as $item) {
        echo $item['id'];
    }
} catch (ApiException $e) {
    echo $e->getMessage();
}
```

The cursor will iterate over individual entities. When all entities have been iterated over it will automatically fetch the next page if available.

Note: Even if you supply a limit query parameter, the cursor will still iterate over all available entities in Netsuite.

```
$cursor = $client->currency->list(['limit' => 3]);
```

The `limit` query parameter only provides the ability to set how many entities to fetch on each API call.

If you want to only iterate over a set number of entities even though there is more available then wrap the cursor in a `LimitIterator`.

```
 $cursor = $client->customer->list(['limit' => 10]);
 foreach (new LimitIterator($cursor, 0, 10) as $item) {
    ...
 }
```

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.3% 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 ~63 days

Recently: every ~79 days

Total

6

Last Release

449d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8d1ba605a0d5efec9649a10ac22f37d0c140e8ee928daac34686e987719bee17?d=identicon)[Asim](/maintainers/Asim)

---

Top Contributors

[![asimlqt](https://avatars.githubusercontent.com/u/1963846?v=4)](https://github.com/asimlqt "asimlqt (14 commits)")[![mlahargou](https://avatars.githubusercontent.com/u/29667789?v=4)](https://github.com/mlahargou "mlahargou (1 commits)")

### Embed Badge

![Health badge](/badges/asimlqt-netsuite-rest-api-php/health.svg)

```
[![Health](https://phpackages.com/badges/asimlqt-netsuite-rest-api-php/health.svg)](https://phpackages.com/packages/asimlqt-netsuite-rest-api-php)
```

###  Alternatives

[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

35789.4k2](/packages/telnyx-telnyx-php)[openai-php/client

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

5.8k28.0M318](/packages/openai-php-client)[deeplcom/deepl-php

Official DeepL API Client Library

2607.3M113](/packages/deeplcom-deepl-php)[n1ebieski/ksef-php-client

PHP API client that allows you to interact with the API Krajowego Systemu e-Faktur

9067.8k](/packages/n1ebieski-ksef-php-client)[trycourier/courier

Courier PHP SDK

15660.9k](/packages/trycourier-courier)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

1003.9M50](/packages/getbrevo-brevo-php)

PHPackages © 2026

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