Skip to main content

Sales Order API

Create, read, update, and delete sales orders using the NetSuite REST API.


Endpoints​

MethodEndpointDescription
GET/record/v1/salesOrderList all sales orders
GET/record/v1/salesOrder/{id}Get specific sales order
POST/record/v1/salesOrderCreate new sales order
PATCH/record/v1/salesOrder/{id}Update sales order
DELETE/record/v1/salesOrder/{id}Delete sales order

Key Fields​

Header Fields​

FieldTypeDescriptionRequired
idstringInternal ID (read-only)-
tranIdstringTransaction numberAuto-generated
entityobjectCustomer referenceYes
tranDatestringTransaction date (ISO 8601)Yes
dueDatestringDue dateNo
orderStatusobjectOrder statusRead-only
subsidiaryobjectSubsidiaryYes (OneWorld)
locationobjectLocationNo
departmentobjectDepartmentNo
classobjectClassificationNo

Financial Fields​

| Field | Type | Description | |-------|------|-------------|----------| | currency | object | Transaction currency | Yes | | exchangeRate | number | Exchange rate | Auto-calculated | | subTotal | number | Subtotal (read-only) | - | | taxTotal | number | Total tax (read-only) | - | | total | number | Grand total (read-only) | - | | terms | object | Payment terms | No |

Shipping & Billing​

FieldTypeDescription
shipDatestringShip date
shipMethodobjectShipping method
shippingCostnumberShipping cost
handlingCostnumberHandling cost
billAddr1stringBilling address line 1
billCitystringBilling city
billStatestringBilling state
billZipstringBilling ZIP
billCountryobjectBilling country
shipAddr1stringShipping address line 1
shipCitystringShipping city
shipStatestringShipping state
shipZipstringShipping ZIP
shipCountryobjectShipping country

Other Fields​

FieldTypeDescription
salesRepobjectSales representative
memostringMemo/notes
messageobjectMessage to customer
otherRefNumstringPO# / Reference number

Sublists​

FieldTypeDescription
itemcollectionLine items

Example: Create Sales Order​

POST /record/v1/salesOrder
Content-Type: application/json
{
"entity": {
"id": "456"
},
"tranDate": "2025-12-25",
"subsidiary": {
"id": "1"
},
"currency": {
"id": "1"
},
"terms": {
"id": "2"
},
"salesRep": {
"id": "123"
},
"otherRefNum": "PO-12345",
"memo": "Rush order - ship ASAP",
"item": {
"items": [
{
"item": {
"id": "789"
},
"quantity": 10,
"rate": 99.99,
"amount": 999.90,
"taxCode": {
"id": "5"
}
},
{
"item": {
"id": "790"
},
"quantity": 5,
"rate": 149.99,
"amount": 749.95
}
]
},
"shippingCost": 25.00
}

Response​

{
"links": [
{
"rel": "self",
"href": "https://1234567.suitetalk.api.netsuite.com/services/rest/record/v1/salesOrder/1001"
}
],
"id": "1001",
"refName": "Sales Order #SO-1001",
"tranId": "SO-1001",
"entity": {
"id": "456",
"refName": "Acme Corporation"
},
"tranDate": "2025-12-25",
"status": {
"id": "PENDING_APPROVAL",
"refName": "Pending Approval"
},
"subTotal": 1749.85,
"taxTotal": 139.99,
"shippingCost": 25.00,
"total": 1914.84
}

Example: Update Sales Order​

PATCH /record/v1/salesOrder/1001
Content-Type: application/json
{
"memo": "Updated: Customer requested express shipping",
"shipMethod": {
"id": "123"
},
"shippingCost": 50.00
}

Example: Add Line Item​

PATCH /record/v1/salesOrder/1001
Content-Type: application/json
{
"item": {
"items": [
{
"item": { "id": "789" },
"quantity": 10,
"rate": 99.99
},
{
"item": { "id": "790" },
"quantity": 5,
"rate": 149.99
},
{
"item": { "id": "791" },
"quantity": 2,
"rate": 49.99
}
]
}
}
Replace All Items

When updating the item sublist, you must provide ALL line items, not just the new ones. PATCH replaces the entire sublist.


Line Item Fields​

Each item in the item.items array supports:

FieldTypeDescriptionRequired
itemobjectItem referenceYes
quantitynumberQuantity orderedYes
ratenumberUnit priceAuto from item
amountnumberLine total (qty × rate)Auto-calculated
descriptionstringLine descriptionAuto from item
taxCodeobjectTax codeNo
priceobjectPrice levelNo
departmentobjectDepartmentNo
classobjectClassificationNo
locationobjectLocationNo
expectedShipDatestringExpected ship dateNo

Sales Order Statuses​

Status IDDescriptionNext Actions
PENDING_APPROVALPending approvalApprove or reject
PENDING_FULFILLMENTApproved, awaiting fulfillmentCreate item fulfillment
PARTIALLY_FULFILLEDSome items fulfilledFulfill remaining items
PENDING_BILLINGFulfilled, awaiting invoiceCreate invoice
PARTIALLY_BILLEDPartially invoicedCreate remaining invoices
BILLEDFully invoicedN/A - complete
CANCELLEDCancelledN/A
CLOSEDClosedN/A

Query Filters​

Find Pending Approval Orders​

GET /record/v1/salesOrder?q=status='PENDING_APPROVAL'

Find by Customer​

GET /record/v1/salesOrder?q=entity='456'

Find by Date Range​

GET /record/v1/salesOrder?q=tranDate BETWEEN '2025-01-01' AND '2025-12-31'

Find by PO Number​

GET /record/v1/salesOrder?q=otherRefNum='PO-12345'

Find Large Orders​

GET /record/v1/salesOrder?q=total > 10000

Common Workflows​

1. Order to Cash (Standard)​

Sales Order → Item Fulfillment → Invoice → Customer Payment

2. Direct Invoicing​

Sales Order → Invoice (auto-creates fulfillment)

3. Drop Ship​

Sales Order → Purchase Order → Item Receipt → Item Fulfillment → Invoice

Important Notes​

Approval Workflow​

  • If approval workflow is enabled, new orders start in PENDING_APPROVAL status
  • Orders must be approved before fulfillment

Item Availability​

  • NetSuite checks item availability when creating the order
  • If insufficient inventory, order can still be created but will show backorder

Pricing​

  • rate is auto-populated from the item's price level
  • You can override by explicitly setting rate
  • Price level hierarchy: Customer-specific → Price level → Base price

Tax Calculation​

  • Tax is calculated based on:
    • Ship-to address (nexus)
    • Item tax settings
    • Customer tax status
  • taxTotal is automatically calculated

See Also​