Skip to content

insertSalesOrder

WRITE

Create a new sales order with all business logic - generates sequence, creates opportunity, resolves payment/shipping defaults from customer. LLM can create a sales order with just customerId..

POST /api/v1/sales/insertSalesOrder
curl -X POST '<your-host>/api/v1/sales/insertSalesOrder' \
  -H 'Authorization: Bearer <api-key>' \
  -H 'Content-Type: application/json' \
  -d '{
    "customerId": "string"
  }'
Response
{
  "id": "string",
  "salesOrderId": "string"
}

Parameters

ParameterType
"Draft""In Progress""Needs Approval""To Ship and Invoice""To Ship""To Invoice""Completed""Cancelled""Closed"

Input schema

schema
{
  "type": "object",
  "properties": {
    "customerId": {
      "type": "string"
    },
    "salesOrderId": {
      "type": "string"
    },
    "locationId": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "Draft",
        "In Progress",
        "Needs Approval",
        "To Ship and Invoice",
        "To Ship",
        "To Invoice",
        "Completed",
        "Cancelled",
        "Closed"
      ]
    },
    "currencyCode": {
      "type": "string"
    },
    "orderDate": {
      "type": "string"
    },
    "customerContactId": {
      "type": "string"
    },
    "customerLocationId": {
      "type": "string"
    },
    "quoteId": {
      "type": "string"
    },
    "opportunityId": {
      "type": "string"
    },
    "requestedDate": {
      "type": "string"
    },
    "promisedDate": {
      "type": "string"
    },
    "notes": {
      "type": "string"
    },
    "customerReference": {
      "type": "string"
    },
    "customerEngineeringContactId": {
      "type": "string"
    },
    "salesPersonId": {
      "type": "string"
    },
    "customFields": {}
  },
  "required": [
    "customerId"
  ]
}