SuitePortal
Developer GuideAPI Reference

API Overview

SuitePortal REST API for accessing synced transaction data

API Overview

The SuitePortal API provides read-only access to transaction data synced from NetSuite. All endpoints require authentication via Better Auth API keys.

Base URL

https://suiteportal.io/api/v1

Authentication

All requests require an API key in the Authorization header:

Authorization: Bearer sp-{timestamp}-{hash}

API keys are scoped to an organization. The tenantId is automatically derived from the API key—no tenant parameter is required.

See Authentication for details on obtaining API keys.

Available Endpoints

EndpointMethodDescription
/api/v1/invoicesGETList invoice transactions
/api/v1/salesGETList sales order transactions
/api/v1/purchasesGETList purchase order transactions
/api/v1/fulfillmentsGETList item fulfillment transactions

Common Query Parameters

All transaction endpoints support:

ParameterTypeDefaultDescription
pagenumber1Page number (1-indexed)
pageSizenumber50Records per page
searchstringText search across tranId, entity, memo
sortBystringtranDateField to sort by
sortDirectionasc | descascSort order
filters[]stringFilter in key:value format (repeatable)

Response Format

{
  "data": [
    {
      "_id": "tenant-123:transaction:invoice:456",
      "nsId": "456",
      "recordType": "invoice",
      "syncedAt": "2024-01-15T10:30:00.000Z",
      "data": {
        "tranId": "INV-001",
        "entity": "12345",
        "tranDate": "2024-01-15",
        "amount": 1000.00
      }
    }
  ],
  "total": 100,
  "page": 1,
  "pageSize": 50,
  "totalPages": 2
}

Response Fields

FieldTypeDescription
dataarrayArray of transaction records
data[]._idstringUnique record identifier
data[].nsIdstringNetSuite internal ID
data[].recordTypestringTransaction type
data[].syncedAtstringISO timestamp of last sync
data[].dataobjectTransaction data fields
totalnumberTotal matching records
pagenumberCurrent page
pageSizenumberRecords per page
totalPagesnumberTotal pages

Error Responses

StatusErrorDescription
400Invalid record typeEndpoint path not recognized
401API key requiredMissing Authorization header
401Invalid API keyAPI key not found or expired
403Access deniedUser not member of organization
500Server errorInternal server error

Row-Level Security

Data access is automatically scoped by portal type:

Portal TypeAccess
TenantAll transactions for the tenant
CustomerTransactions where entity = customer ID
VendorTransactions where entity = vendor ID

API Capabilities

FeatureSupported
Read transactions
Create transactions
Update transactions
Delete transactions
Write to NetSuite

The API is read-only. To modify data, make changes in NetSuite and sync.

Rate Limits

Rate limiting is currently disabled. Fair usage policies apply.

Next Steps