This repository contains the OpenAPI (Swagger) specification for the NetSuite REST API (version 2024.2). The YAML file provided here allows developers to interact with NetSuite's REST API using tools like Swagger Editor, Postman, or to generate client libraries in various programming languages.
- API Version: 2024.2
- Specification File:
ns-restapi-v1.yaml - Supported Record Types:
- Customer
- Invoice
- Sales Order
- Item
- Authentication: OAuth 2.0 (Client Credentials Flow)
- Comprehensive Endpoints: Includes paths for listing, creating, retrieving, updating, and deleting records.
- Data Models: Detailed schemas for each record type, including nested objects.
- Extensibility: Easily add more record types or customize existing ones based on your NetSuite configuration.
- NetSuite Account: You must have an active NetSuite account with REST Web Services enabled.
- OAuth 2.0 Credentials: Obtain your Client ID and Client Secret from NetSuite.
- Tools:
- Swagger Editor or any OpenAPI-compatible tool.
- Optional: Postman for API testing.
-
Clone the Repository:
git clone https://github.com/yourusername/netsuite-rest-api-specification.git
-
Navigate to the Directory:
cd netsuite-rest-api-specification -
Open the YAML File: Use your preferred text editor to open
netsuite_rest_api.yaml. -
Replace Account ID: Find
{accountId}in theserverssection and thetokenUrlundersecuritySchemes. Replace it with your actual NetSuite account ID.servers: - url: https://123456.suitetalk.api.netsuite.com/services/rest/record/v1
Save the File.
- Open Swagger Editor: Go to https://editor.swagger.io/.
- Import the YAML File:
Click on
File > Import Fileand selectnetsuite_rest_api.yaml. - Explore the API: Navigate through the available endpoints and models.
- Set Up Authentication:
Click on the Authorize button (padlock icon).
Enter your Client ID and Client Secret.
Scope should berest_webservices.
- Method: GET
- Endpoint:
/customer
- Method: POST
- Endpoint:
/invoice - Body: Provide an Invoice object as per the schema.
The API uses OAuth 2.0 Client Credentials Flow.
- Token URL:
https://{accountId}.suitetalk.api.netsuite.com/services/rest/auth/oauth2/v1/token - Scopes:
rest_webservices: Access to NetSuite REST web services.
- Log in to NetSuite.
- Navigate to:
Setup > Integration > Manage Integrations > New. - Create a New Integration:
- Enable OAuth 2.0.
- Note down the Client ID and Client Secret.
- Duplicate existing paths and schemas.
- Update the record type names and properties.
- Modify the properties under each schema to match your NetSuite fields.
Contributions are welcome!
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Commit your changes.
- Push the branch to your fork.
- Submit a Pull Request.
This project is licensed under the MIT License.
- Author: Philip Denys
- Email: philip.denys@logitail.com
- GitHub: @philip-denys
- NetSuite REST API Browser: Official Documentation
- Swagger Editor: https://editor.swagger.io/
- NetSuite Support: Support Center
This repository is not affiliated with or endorsed by NetSuite. It is intended for educational and developmental purposes.