Skip to content

How to Close a NetSuite SalesOrder Using SuiteTalk

Tags: netsuite, suitetalk • Categories: Web Development

Table of Contents

Many things in NetSuite’s SuiteTalk XML API are not intuitive or obvious: closing a SalesOrder is one of them.

When you create a SalesOrder using upsert or add you can set the order_status to _pendingFulfillment or _pendingApproval directly through the order_status field. However, you can’t simply update the order_status field on a SalesOrder to close the record, you need to set is_closed field on each line item in the SalesOrder.

ns_order.item_list.items do |item|
  item.is_closed = true
end

ns_order.update({ item_list: ns_order.item_list })

Other SalesOrder states work in a similar way: _partiallyFulfilled, _fulfilled, etc are only achieved by modified the item_list sublist or by creating a separate record (ItemFulfillment, Invoice, etc).

2 responses to “How to Close a NetSuite SalesOrder Using SuiteTalk

  1. Hi Michael, I don’t know Netsuite but have been asked to integrate a download or SO’s to another system, fulfill them there and then update the SO in Netsuite to allow invoicing to proceed. Two posts I’ve seen from you already suggest you as a valuable guide. Could I ask tow questions? (i) Can I just close the SO lines as you’ve described to allow invoicing or does Netsuite always require an ItemFulfillment to proceed? (ii) Do you know if short shipments are possible – in which case I suppose one would need some corresponding ItemFulfillment record – or can we reset item_list? Finally, do you engage directly if we have more questions?

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep in Touch

Subscribe to my email list to keep in touch. I’ll send you new blog posts and other thoughts.