RPA.Netsuite

module RPA.Netsuite

class RPA.Netsuite.Netsuite

Netsuite is a library for accessing Netsuite using NetSuite SOAP web service SuiteTalk. The library extends the netsuitesdk library.

More information available at NetSuite SOAP webservice SuiteTalk.

Examples

Robot Framework

Python

from RPA.Netsuite import Netsuite ns = Netsuite() ns.connect() accounts = ns.get_accounts() currencies = ns.get_currencies()

variable ROBOT_LIBRARY_DOC_FORMAT

ROBOT_LIBRARY_DOC_FORMAT = 'REST'

variable ROBOT_LIBRARY_SCOPE

ROBOT_LIBRARY_SCOPE = 'GLOBAL'

method connect

connect(account: Optional[str] = None, consumer_key: Optional[str] = None, consumer_secret: Optional[str] = None, token_key: Optional[str] = None, token_secret: Optional[str] = None)

Connect to Netsuite with credentials from environment variables.

Parameters are not logged into Robot Framework log.

Parameters
  • account – parameter or environment variable NS_ACCOUNT
  • consumer_key – parameter or environment variable NS_CONSUMER_KEY
  • consumer_secret – parameter or environment variable NS_CONSUMER_SECRET
  • token_key – parameter or environment variable NS_TOKEN_KEY
  • token_secret – parameter or environment variable NS_TOKEN_SECRET

method get_accounts

get_accounts(count: int = 100, account_type: str = None)

Get Accounts of any type or specified type.

Parameters
  • count – number of Accounts to return, defaults to 100
  • account_type – if None returns all account types, example. β€œ_expense”, defaults to None
  • Returns: accounts

method get_classifications

get_classifications()

Get all Netsuite Classifications

  • Returns: classifications

method get_currencies

get_currencies()

Get all Netsuite Currencies

  • Returns: currencies

method get_currency

get_currency(currency_id: str)

Get all a Netsuite Currency by its ID

  • Parameters: currency_id – ID of the currency to get
  • Returns: currency

method get_departments

get_departments()

Get all Netsuite Departments

  • Returns: departments

method get_locations

get_locations()

Get all Netsuite Locations

  • Returns: locations

method get_vendor_bills

get_vendor_bills(count: int = 10)

Get list of vendor bills

  • Parameters: count – number of vendor bills to return, defaults to 10
  • Returns: list of vendor bills

method get_vendors

get_vendors(count: int = 10)

Get list of vendors

  • Parameters: count – number of vendors to return, defaults to 10
  • Returns: list of vendors

method login

login(account: Optional[str] = None, email: Optional[str] = None, password: Optional[str] = None, role: Optional[str] = None, appid: Optional[str] = None)

Login to Netsuite with credentials from environment variables

Parameters are not logged into Robot Framework log.

Parameters
  • account – parameter or environment variable NS_ACCOUNT
  • email – parameter or environment variable NS_EMAIL
  • password – parameter or environment variable NS_PASSWORD
  • role – parameter or environment variable NS_ROLE
  • appid – parameter or environment variable NS_APPID

method netsuite_get

netsuite_get(record_type: str = None, internal_id: str = None, external_id: str = None)

Get all records of given type and internalId and/or externalId.

Parameters
  • record_type – type of Netsuite record to get
  • internal_id – internalId of the type, default None
  • external_id – external_id of the type, default None
  • Raises: ValueError – if record_type is not given
  • Returns: records as a list or None

method netsuite_get_all

netsuite_get_all(record_type: str)

Get all records of given type.

  • Parameters: record_type – type of Netsuite record to get
  • Raises: ValueError – if record_type is not given
  • Returns: records as a list or None

method netsuite_search

netsuite_search(type_name: str, search_value: str, operator: str = 'contains', page_size: int = 5)

Search Netsuite for value from a type. Default operator is contains.

Parameters
  • type_name – search target type name
  • search_value – what to search for within type
  • operator – name of the operation, defaults to β€œcontains”
  • page_size – result items within one page, defaults to 5
  • Returns: paginated search object

method netsuite_search_all

netsuite_search_all(type_name: str, page_size: int = 20)

Search Netsuite for a type results.

Parameters
  • type_name – search target type name
  • page_size – result items within one page, defaults to 5
  • Returns: paginated search object