Registry / crm-productivity / netsuitesdk

netsuitesdk

JSON →
library3.3.0pypypi✓ verified 22d ago

Netsuite-sdk-py is a Python SDK for accessing NetSuite resources via the NetSuite SOAP web service SuiteTalk. It leverages the `zeep` library internally but abstracts its complexity, providing a simplified interface for interacting with NetSuite APIs. The library is actively maintained with frequent releases, currently at version 3.1.2.

pip install netsuitesdk
INSTALL
IMPORT
SIG · NETSUITESDK
N
netsuitesdk
crm-productivitypythonv3.3.0
Install
3.2s avg
Import
567ms
Disk
35MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.3.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.584s · 36.1MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.2s · import 0.550s · 37MB
35MB installed
● package 35MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

NetSuiteConnection
from netsuitesdk import NetSuiteConnection
from netsuitesdk.internal.client import NetSuiteClient
The primary client class is exposed directly from the top-level package, not its internal module.

This quickstart demonstrates how to establish a Token-Based Authentication (TBA) connection to NetSuite using the `netsuitesdk`. It reads credentials from environment variables and then performs a simple query to fetch a list of currencies. NetSuite requires TBA for highly privileged roles.

import os from netsuitesdk import NetSuiteConnection from netsuitesdk.exceptions import NetSuiteLoginError # Ensure these environment variables are set with your NetSuite TBA credentials NS_ACCOUNT = os.getenv('NS_ACCOUNT', 'YOUR_ACCOUNT_ID') NS_CONSUMER_KEY = os.getenv('NS_CONSUMER_KEY', 'YOUR_CONSUMER_KEY') NS_CONSUMER_SECRET = os.getenv('NS_CONSUMER_SECRET', 'YOUR_CONSUMER_SECRET') NS_TOKEN_KEY = os.getenv('NS_TOKEN_KEY', 'YOUR_TOKEN_KEY') NS_TOKEN_SECRET = os.getenv('NS_TOKEN_SECRET', 'YOUR_TOKEN_SECRET') if 'YOUR' in NS_ACCOUNT: print("Please set NS_ACCOUNT, NS_CONSUMER_KEY, NS_CONSUMER_SECRET, NS_TOKEN_KEY, NS_TOKEN_SECRET environment variables.") else: try: nc = NetSuiteConnection( account=NS_ACCOUNT, consumer_key=NS_CONSUMER_KEY, consumer_secret=NS_CONSUMER_SECRET, token_key=NS_TOKEN_KEY, token_secret=NS_TOKEN_SECRET ) print(f"Successfully connected to NetSuite account: {nc.account}") # Example: Fetch all currencies currencies = nc.currencies.get_all() print(f"Found {len(currencies)} currencies. First 3: {currencies[:3]}") except NetSuiteLoginError as e: print(f"NetSuite login failed: {e}") except Exception as e: print(f"An unexpected error occurred: {e}")
Debug
Known issues
breakingStarting from version 3.0.0, the default WSDL version used by the SDK changed from '2019_1' to '2024_1'. If your NetSuite account is older or if your integration explicitly relies on an older WSDL version, you might experience compatibility issues.
fix
If necessary, explicitly pass the `wsdl_version` parameter when initializing `NetSuiteConnection`, e.g., `NetSuiteConnection(..., wsdl_version='2019_1')`.
affects: >=3.0.0
breakingVersion 3.0.1 removed the 'Passport Complex Type'. Integrations that were directly utilizing this specific complex type will break.
fix
Review your code for direct references to 'Passport Complex Type' and adjust your authentication or record handling methods as per the updated SDK and NetSuite API documentation. Token-Based Authentication (TBA) is the recommended approach.
affects: >=3.0.1
gotchaAuthentication failures are common, often due to NetSuite's Two-Factor Authentication (2FA) for highly privileged roles, revoked or expired access tokens, or insufficient role permissions. Roles used for integration must have 'Web Services access' and 'Log in using Access Tokens' permissions.
fix
Always use Token-Based Authentication (TBA) with a dedicated integration role that has only the necessary permissions (not an Administrator role if 2FA is active). Regularly check token validity and ensure the associated NetSuite user account is active.
affects: All
gotchaIncorrect NetSuite role permissions can lead to 'INSUFFICIENT_PERMISSION' errors or silently missing data. Even if authenticated, the user role might lack access to specific record types or fields required for an operation.
fix
Ensure the role assigned to your integration user has 'Full' access to all relevant permissions (e.g., Permissions, Reports, Lists, Setup, Custom Records) for the data you intend to access or modify. Use NetSuite's Records Browser to confirm correct internal field names.
affects: All
gotchaUsing incorrect internal IDs or field names for NetSuite records is a frequent source of errors (e.g., 'INVALID_FIELD_FOR_RECORD_TYPE'). NetSuite often uses specific internal field names that may not match display names.
fix
Always verify internal IDs and field names using the NetSuite Records Browser or developer tools. Avoid hardcoding values that are subject to change in NetSuite configurations.
affects: All
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'netsuitesdk'
The `netsuitesdk` package has not been installed in your Python environment.
fix
pip install netsuitesdk
Authentication failed
The provided NetSuite credentials (account, consumer key/secret, token key/secret) are incorrect, expired, or the associated role lacks 'Web Services' permissions or 'Token-Based Authentication' is not enabled in NetSuite.
fix
Ensure all `NS_ACCOUNT`, `NS_CONSUMER_KEY`, `NS_CONSUMER_SECRET`, `NS_TOKEN_KEY`, and `NS_TOKEN_SECRET` environment variables are correctly set with valid and active Token-Based Authentication credentials. Verify that the associated NetSuite role has 'Web Services' permissions enabled and that TBA is active in the NetSuite account.
INSUFFICIENT_PERMISSION
The NetSuite role associated with the integration credentials lacks the necessary permissions to access, create, or modify the specific record type or perform the requested action.
fix
In NetSuite, navigate to Setup > Users/Roles > Manage Roles and ensure the role assigned to your integration user has 'Full' or 'Edit' permissions for the relevant record types and lists/transactions. Also, confirm that 'SOAP Web Services' feature is enabled for the account.
SuiteTalk endpoint version XXXX is no longer supported.
The WSDL version specified in your `netsuitesdk` connection is deprecated by NetSuite, as older API versions are periodically retired.
fix
Update your `netsuitesdk` connection to use a currently supported WSDL version (e.g., '2024_1'). The `netsuitesdk` library defaults to a recent version, but if explicitly set to an old version, it needs to be updated.
ImportError: cannot import name 'NetSuiteConnection' from 'netsuitesdk'
The `NetSuiteConnection` class is being imported incorrectly, possibly due to a typo or a change in the library's structure or if trying to import from an internal module directly.
fix
Ensure you are importing the `NetSuiteConnection` class directly from the top-level `netsuitesdk` package: `from netsuitesdk import NetSuiteConnection`.
Upgrade
Version history
3.3.0latest on PyPI · released Jul 21, 2026
Audit
Dependencies
zeeprequiredCore SOAP client library used internally to interact with NetSuite's SuiteTalk web service.
Agent activity
23 hits · last 30 days
node
18
OpenAI (training)
1
Resources