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)525.8k↓25.5%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 1mo 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

35

—

LowBetter than 80% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity34

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

403d 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

[openai-php/client

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

5.8k22.6M232](/packages/openai-php-client)[deeplcom/deepl-php

Official DeepL API Client Library

2616.2M66](/packages/deeplcom-deepl-php)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

963.1M35](/packages/getbrevo-brevo-php)[swisnl/json-api-client

A PHP package for mapping remote JSON:API resources to Eloquent like models and collections.

211473.2k12](/packages/swisnl-json-api-client)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[mariosimao/notion-sdk-php

A complete Notion SDK for PHP developers.

171225.1k1](/packages/mariosimao-notion-sdk-php)

PHPackages © 2026

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