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 netsuitesdkVerified import paths — ran on the pinned version, not inferred.
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.
If necessary, explicitly pass the `wsdl_version` parameter when initializing `NetSuiteConnection`, e.g., `NetSuiteConnection(..., wsdl_version='2019_1')`.
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.
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.
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.
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.
pip install netsuitesdk
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.
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.
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.
Ensure you are importing the `NetSuiteConnection` class directly from the top-level `netsuitesdk` package: `from netsuitesdk import NetSuiteConnection`.