# Acumatica Sales Order REST JSON Template

> Source: https://netray.co/tools/acumatica-sales-order-rest-json-template
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: Free Tools

## Short answer

Generate the PUT request URL and JSON body to create a sales order with two lines through Acumatica's contract-based REST API.

## Category

developer

## Erp

Acumatica

## Audience

- Integration developer
- ERP consultant
- Web developer

## Tool

**Kind:** template

**Output:** code

**Language:** json

**Fields:**

#### Instance URL

**Key:** host

**Type:** text

**Default:** https://yourcompany.acumatica.com

#### Site / instance name

**Key:** instance

**Type:** text

**Help:** Leave blank for cloud sites that have no virtual directory.

#### Default endpoint version

**Key:** endpoint_version

**Type:** text

**Default:** 24.200.001

**Help:** Check the endpoint list in Web Service Endpoints (SM207060) for your version.

#### Order type

**Key:** order_type

**Type:** text

**Default:** SO

#### Customer ID

**Key:** customer

**Type:** text

**Default:** ABCHOLDING

#### Customer order number

**Key:** cust_order

**Type:** text

**Default:** PO-77412

#### Warehouse

**Key:** warehouse

**Type:** text

**Default:** MAIN

#### Line 1 inventory ID

**Key:** item1

**Type:** text

**Default:** AALEGO500

#### Line 1 quantity

**Key:** qty1

**Type:** number

**Default:** 10

#### Line 2 inventory ID

**Key:** item2

**Type:** text

**Default:** CONGRILL

#### Line 2 quantity

**Key:** qty2

**Type:** number

**Default:** 4

#### Order description

**Key:** desc

**Type:** text

**Default:** Web order via integration

**Blocks:**

#### Request

**Body:** PUT {{host}}/{{instance}}/entity/Default/{{endpoint_version}}/SalesOrder
Content-Type: application/json
Accept: application/json
Cookie: .ASPXAUTH=<session cookie from login>

#### JSON body

**Body:** {
  "OrderType": { "value": "{{order_type}}" },
  "CustomerID": { "value": "{{customer}}" },
  "CustomerOrder": { "value": "{{cust_order}}" },
  "Description": { "value": "{{desc}}" },
  "Details": [
    {
      "InventoryID": { "value": "{{item1}}" },
      "OrderQty": { "value": {{qty1}} },
      "WarehouseID": { "value": "{{warehouse}}" }
    },
    {
      "InventoryID": { "value": "{{item2}}" },
      "OrderQty": { "value": {{qty2}} },
      "WarehouseID": { "value": "{{warehouse}}" }
    }
  ]
}

#### Login (before the PUT)

**Body:** POST {{host}}/{{instance}}/entity/auth/login
Content-Type: application/json

{
  "name": "<api user>",
  "password": "<password>",
  "company": "<company/tenant>"
}

#### Logout (after the PUT)

**Body:** POST {{host}}/{{instance}}/entity/auth/logout

**Notes:** Verify field names against your endpoint version in Web Service Endpoints and test in a non-production tenant. If the instance name is blank, remove the double slash from the URL. For OAuth 2.0 connected applications, use a bearer token instead of the login cookie. Always release API sessions with logout, as concurrent API session limits apply.

## Content

**Intro:** Creating a sales order through Acumatica's contract-based REST API is a PUT to the SalesOrder entity with every field wrapped as a value object. This generator builds the URL and body so you can test it in Postman or code.

**Sections:**

#### How to use it

**Body:** Enter your instance URL, endpoint version, order type, customer and up to two lines. Copy the login call, the PUT and the logout call into your REST client in that order. A successful PUT returns the created order with its number and defaulted fields. If the response carries validation errors, they refer to the field names in the body, which makes mapping problems easy to find.

**Bullets:**

- Authenticate first, then call the entity
- Send quantities as numbers, not strings
- Log out when finished to free the API session
- Test in a sandbox tenant before production

#### How the contract-based API works

**Body:** Acumatica exposes entities through web service endpoints. The Default endpoint ships with versioned contracts such as 24.200.001, and you can extend it or define your own in Web Service Endpoints. Each field is sent as an object with a value property, and detail lines are an array under Details. A PUT creates the record or updates it if the key fields match. Related actions such as releasing or confirming shipment are separate action endpoints.

#### Reading the response

**Body:** The response echoes the saved order with identifiers such as OrderNbr and calculated fields like totals and status. Check the status and any approval hold, because a new order can land On Hold or Pending Approval depending on the order type configuration. Custom fields appear only if they are included in the endpoint definition. Use the expand parameter when you need related entities in the response.

#### Common mistakes

**Body:** Forgetting the value wrapper is the top error. Others include using the wrong endpoint version for the site, sending an inventory ID with the wrong segment format, leaving sessions open until the concurrent limit is reached, and creating orders for customers on credit hold. Also be careful with retries: repeating a PUT without a unique customer order check can duplicate orders.

**Cta:** If you are building integrations for web orders, EDI or quoting tools, we can help design and test them, with human approval on any write-back.

**Faq:**

#### Which endpoint version should I use?

**Answer:** Use the version listed in Web Service Endpoints for your Acumatica release. The version in the URL must match an existing endpoint on the site. If you built a custom endpoint, use its name and version in the path instead of Default.

#### How do I authenticate?

**Answer:** Either a cookie based login through the auth login endpoint or an OAuth 2.0 connected application with a bearer token. OAuth is preferred for production integrations because credentials are not sent with every session.

#### Can I add more than two lines?

**Answer:** Yes. Add more objects to the Details array following the same pattern. The generator provides two to show the structure. For large orders, consider batching and check the response times in your tenant.

#### Does this release the order or create a shipment?

**Answer:** No. This creates the order only. Further steps such as creating a shipment or releasing are separate actions on the relevant entities and depend on your order type setup.

## Search terms

acumatica rest api create sales order, acumatica contract based api json example, acumatica salesorder put json, acumatica api sales order payload, acumatica rest api example, acumatica integration sales order json

---
Talk to an engineer: https://netray.co/contact?intent=erp_ai | Machine catalog: https://netray.co/agent/catalog.json
