---
title: "Create Order Header"
method: POST
path: "/salesorders"
tags: ["Orders / Entity"]
---

# Create Order Header

`POST /salesorders`

## Request

- Base URL: `https://api.forcemanager.com/api/v4`
- URL: `https://api.forcemanager.com/api/v4/salesorders`
- Auth: API key in header `X-Session-Key`

This endpoint allows you to create am Order Header based on JSON input.

You will only be able to create an Order Header after first providing the Session Key. To know how you can obtain the Session Key, [go to Authentication](#tag/authentication/POST/login).

**HEADERS**

| **Parameter** | **Value** | **Description** |
| --- | --- | --- |
| Content-Type | application/json | Language in which all request and response bodies are encoded |
| Accept | \*/\* | Any data of whatever mime type is accepted |
| X-Session-Key | AUTH_TOKEN | This field must be completed with the token obtained at the authentication |
| X-FM-Entity-Count | {number} | The number of records to return in each page of results. The default page limit is 50 |
| ExtraFieldDescription | {number} | If equal to "0", the response returns only the value of each Extra Fields, if equal to "1" also the description is returned |

**REQUEST BODY**

| **Attribute** | **Type** | **Description** |
| --- | --- | --- |
| accountAddressId | Integer | Account's address to which the Order is linked to (see [Address](#) resource) |
| accountId | Integer | Account to which the Order Header is linked to (see [Accounts](#) resource) |
| archived | Boolean | If true, the Order has been archived |
| blocked | Boolean | If true, the Order has been temporary locked to prevent edits (e.g. when a signature is in progress) |
| branchId (_Required_) | Integer | Branch to which the Order has been assigned (see [Branches](#) resource) |
| closedDate | String | Date when the Order has been closed |
| comment | String | Comment added to the Order |
| contactId | Integer | Contact to which the Order Header is linked to (see [Contacts](#) resource) |
| currencyId | Integer | Currency type (see [Currencies](#) resource) |
| discount1 | Number | First discount that can be applied to the Order, in percents |
| discount2 | Number | Second discount that can be applied to the Order, in percents |
| discount3 | Number | Third discount that can be applied to the Order, in percents |
| discount4 | Number | Fourth discount that can be applied to the Order, in percents |
| extId | String | External ID of the Order from a third party system (ERP, CRM, Accounting System) |
| internalComment | String | Internal comment |
| mainSalesorder | Boolean | If true, the Order is relevant for the linked opportunity |
| opportunityId | Integer | Opportunity to which the Order is linked to (see [Opportunities](#) resource) |
| rateId | Integer | Rate for the Order Header (see [Rates](#) resource) |
| readOnly | Boolean | If true, the Order Header cannot be modified or deleted |
| reference (_Required_) | String | Order Header's label |
| number | Integer | Order number (should be sequential and unique in general) |
| salesForcecastDate | String | Forecast date for the Sale |
| salesRepId (_Required_) | Integer | User responsible for the Order |
| statusId | Integer | Status of the Order (see [Statues](#) resource) |
| total | Number | Total amount of the Order |
| year | Integer | Year when the Order was created |

**RESPONSE**

Returns a JSON with information about the Order Header just created.

| **Attribute** | **Type** | **Description** |
| --- | --- | --- |
| id | Integer | Id assigned to the new Order Header |
| Message | String | Shows the operation status |

**RESPONSE CODES**

| **Status** | **Description** |
| --- | --- |
| 200 OK | Shows if operation succeeded |
| 400 Bad Request | Shows when an invalid request or the requested service is not available |

## Headers

- `Accept` string

## Request body

- object
  - `accountAddressId` string
  - `accountId` integer
  - `archived` boolean
  - `branchId` integer
  - `closedDate` string
  - `comment` string
  - `contactId` string
  - `currencyId` string
  - `discount1` integer
  - `discount2` integer
  - `discount3` integer
  - `discount4` integer
  - `extId` string
  - `internalComment` string
  - `internalCommentUpdateDate` string
  - `internalCommentUpdateSalesRepId` string
  - `mainSalesorder` string
  - `number` integer
  - `opportunityId` string
  - `rateId` integer
  - `readOnly` boolean
  - `reference` string
  - `salesRepId` integer
  - `statusId` integer
  - `total` integer
  - `year` integer

## Response `200`

Create Order Header

---

[API](https://skmtc.dev/forcemanager/apis/sage-sales-management-public-api-documentation-for-developer.md) · [All operations](https://skmtc.dev/forcemanager/apis/sage-sales-management-public-api-documentation-for-developer/llms.txt) · [OpenAPI document](https://skmtc.dev/forcemanager/apis/sage-sales-management-public-api-documentation-for-developer/revisions/87db17204e2f?raw)
