Orders

Get all orders

get

This method retrieves a list of all external orders along with their details, such as order numbers, priority, client information, and timestamps.

Authorizations
Header parameters
x-tenant-idstring · uuidRequired

Tenant id (uuid v4)

Responses
200Success
application/json
get
/api/v1/public/orders
GET /api/v1/public/orders HTTP/1.1
Host: 
x-api-key: YOUR_API_KEY
x-tenant-id: 123e4567-e89b-12d3-a456-426614174000
Accept: */*
200Success
[
  {
    "id": "b86fa12a-76fc-46f5-8a3e-bf39e7be4c4e",
    "external_order_number": "external-order-number",
    "marketplace_order_number": "marketplace_order_number",
    "external_order_id": "external-order-id",
    "order_key": "order-key-123",
    "comment": "fragile",
    "to_stock": false,
    "is_deleted": false,
    "priority": "Medium",
    "client_id": "string",
    "counterparty_id": "string",
    "created_at": "2025-01-23T17:01:31.692Z"
  }
]

Create order

post

This method allows creating a new order, setting order properties, and adding order items. Production items are automatically generated based on the order items' quantity.

Notes

  • If the line_item_id is not provided in the request, HESH generates it and includes it in the response.

  • If the line_item_id is provided, HESH uses it and includes the same ID in the response.

How to check transfered data in HESH

Register in Hesh

  1. Go to your success manager and provide registration email

  2. Receive invitation on the email

  3. Create a password and log in

Open Production Page

  1. If you don't have "Production" page in the sidebar or don't have access contact your success manager

Filter Productions

  1. Choose "Source" filter

  2. Filter productions by External type

Sort Productions

Sort productions by date, deadline and so on

Authorizations
Header parameters
x-tenant-idstring · uuidRequired

Tenant id (uuid v4)

Body
external_order_numberstringRequired

A unique string used in the UI and controlled by the user

Example: ON-12345
external_order_idstringRequired

A unique identifier for each order

Example: b86fa12a-76fc-46f5-8a3e-bf39e7be4c4e
marketplace_order_numberstringOptional

A unique string used in the UI and controlled by the user

Example: MON-986-456
commentstringOptional

Additional comments or info for the order

Example: needs extra packing
deadline_atstring · date-timeOptional

The date when the order should be produced (ISO 8601 format)

Example: 2024-05-17T11:21:47.898Z
external_created_atstring · date-timeOptional

The date when the order was created in an external system (ISO 8601 format)

Example: 2024-05-14T11:21:47.898Z
to_stockbooleanOptional

Indicates if this is an internal company order (e.g., to replenish warehouse stocks)

Example: false
clientall ofOptional

Client information

primary_clientall ofOptional

Primary client information

Responses
201Success
application/json
post
/api/v1/public/orders
POST /api/v1/public/orders HTTP/1.1
Host: 
x-api-key: YOUR_API_KEY
x-tenant-id: 123e4567-e89b-12d3-a456-426614174000
Content-Type: application/json
Accept: */*
Content-Length: 893

{
  "external_order_number": "ON-12345",
  "external_order_id": "b86fa12a-76fc-46f5-8a3e-bf39e7be4c4e",
  "marketplace_order_number": "MON-986-456",
  "comment": "needs extra packing",
  "deadline_at": "2024-05-17T11:21:47.898Z",
  "external_created_at": "2024-05-14T11:21:47.898Z",
  "to_stock": false,
  "client": {
    "name": "Client name",
    "external_client_id": "123456",
    "phone": "937-99-92",
    "email": "[email protected]",
    "company": "Client company"
  },
  "primary_client": {
    "name": "Client name",
    "external_client_id": "123456",
    "phone": "937-99-92",
    "email": "[email protected]",
    "company": "Client company"
  },
  "line_items": [
    {
      "line_item_id": "557657-8654-89i76",
      "barcode": "13465678767",
      "deadline_at": "2024-05-17T11:21:47.898Z",
      "planned_start_date": "2025-04-08T16:56:27.640Z",
      "external_created_at": "2025-04-08T16:56:27.640Z",
      "shipping_deadline": "2025-04-08T16:56:27.640Z",
      "quantity": 3,
      "line_item_note": "Should be smooth",
      "tags": [
        "urgent",
        "fragile"
      ]
    }
  ]
}
201Success
{
  "id": "b86fa12a-76fc-46f5-8a3e-bf39e7be4c4e",
  "external_order_number": "external-order-number",
  "order_key": "O-EX-1",
  "external_order_id": "external-order-id",
  "marketplace_order_number": "marketplace_order_number",
  "marketplace_note": "extra packaging",
  "line_items": [
    {
      "id": "b86fa12a-76fc-46f5-8a3e-bf39e7be4c4e",
      "line_item_id": "b86fa12a-76fc-46f5-8a3e-bf39e7be4c4e",
      "barcode": "453454334234",
      "sku": "product-84620",
      "name": "Super product",
      "quantity": 10,
      "line_item_note": "extra packaging",
      "productions": [
        {
          "production_key": "new-production-key",
          "created_at": "2025-01-22T16:48:25.616Z"
        }
      ]
    }
  ]
}

Cancel external order

post

This method allows to cancel all productions in specified order.

Notes

Productions, additional productions and tasks are not in finished states (not “Done”, “Cancelled”, “From Stock”):

  • the system cancels all productions, tasks and additional components from this order with specified barcodes

  • updates the deadline for the whole order according to the most short term deadline of the item in it

Authorizations
Path parameters
idstringRequired
Header parameters
x-tenant-idstring · uuidRequired

Tenant id (uuid v4)

Responses
201Success
application/json
post
/api/v1/public/orders/{id}
POST /api/v1/public/orders/{id} HTTP/1.1
Host: 
x-api-key: YOUR_API_KEY
x-tenant-id: 123e4567-e89b-12d3-a456-426614174000
Accept: */*
201Success
{
  "id": "b86fa12a-76fc-46f5-8a3e-bf39e7be4c4e",
  "external_order_number": "external-order-number",
  "marketplace_order_number": "marketplace_order_number",
  "external_order_id": "external-order-id",
  "order_key": "order-key-123",
  "comment": "fragile",
  "to_stock": false,
  "is_deleted": false,
  "priority": "Medium",
  "client_id": "string",
  "counterparty_id": "string",
  "created_at": "2025-01-23T17:01:31.692Z"
}

Update order

put

This method allows to update order properties and separate order lines with new values. Any property not provided will be left unchanged.

Scenarios for processing the received data

📝 Amount updated

  • the quantity is increased (past quantity>new quantity)

The system counts by how many units the quantity of the product has increased and adds a separate production item to the order for each unit of the difference

  • the number is decreased (past quantity<new quantity)

The system counts by how many units the quantity of the product has decreased and selects difference number with non-started productions among all in the specified order and cancels them

If decreased difference more than number of non-started productions then system find not finished productions with low production priority and then the smallest progress bar and stops them.

📝 Quantity is zero

If you enter zero in the quantity value in the body of the query, the system will cancel all productions in To Do status and stop all productions in In Progress status of this line item with the specified characteristic. This way, a certain number of created productions with the specified parameters are canceled/stopped within one order.

📝 Line item is missed in request body

Productions are not in finished states - the system cancels all productions from this order with specified barcodes. Updates the deadline for the whole order according to the most short term deadline of the item in it.

📝 Deadline updated

System checks deadlines for each production item with the same barcode in specified order and rewrites them, saving the history and marks that changes were made by external system Updates deadline for the whole order according to the most short term deadline of the item in it.

Authorizations
Path parameters
idstringRequired
external_order_idanyRequired

The unique identifier of the order

Example: b86fa12a-76fc-46f5-8a3e-bf39e7be4c4e
Header parameters
x-tenant-idstring · uuidRequired

Tenant id (uuid v4)

Body
external_order_numberstringOptional

A unique string used in the UI and controlled by the user

Example: ON-12345
marketplace_order_numberstringOptional

A unique string used in the UI and controlled by the user

Example: MON-986-456
commentstringOptional

Additional comments or info for the order

Example: extra packaging
deadline_atstring · date-timeOptional

The date when the order should be produced (ISO 8601 format)

Example: 2025-01-22T16:48:25.617Z
external_created_atstring · date-timeOptional

The date when the order was created in an external system (ISO 8601 format)

Example: 2025-01-22T16:48:25.618Z
to_stockbooleanOptional

Indicates if this is an internal company order (e.g., to replenish warehouse stocks)

Example: true
clientall ofOptional

Client information

primary_clientall ofOptional

Primary client information

Responses
200Success
application/json
put
/api/v1/public/orders/{id}
PUT /api/v1/public/orders/{id} HTTP/1.1
Host: 
x-api-key: YOUR_API_KEY
x-tenant-id: 123e4567-e89b-12d3-a456-426614174000
Content-Type: application/json
Accept: */*
Content-Length: 821

{
  "external_order_number": "ON-12345",
  "marketplace_order_number": "MON-986-456",
  "comment": "extra packaging",
  "deadline_at": "2025-01-22T16:48:25.617Z",
  "external_created_at": "2025-01-22T16:48:25.618Z",
  "to_stock": true,
  "client": {
    "name": "Client name",
    "external_client_id": "123456",
    "phone": "937-99-92",
    "email": "[email protected]",
    "company": "Client company"
  },
  "primary_client": {
    "name": "Client name",
    "external_client_id": "123456",
    "phone": "937-99-92",
    "email": "[email protected]",
    "company": "Client company"
  },
  "line_items": [
    {
      "line_item_id": "b86fa12a-76fc-46f5-8a3e-bf39e7be4c4e",
      "barcode": "453454334234",
      "deadline_at": "2025-01-22T16:48:25.616Z",
      "planned_start_date": "2025-04-08T16:56:27.640Z",
      "external_created_at": "2025-04-08T16:56:27.640Z",
      "shipping_deadline": "2025-04-08T16:56:27.640Z",
      "quantity": 10,
      "line_item_note": "extra packaging"
    }
  ]
}
200Success
{
  "id": "b86fa12a-76fc-46f5-8a3e-bf39e7be4c4e",
  "external_order_number": "external-order-number",
  "order_key": "O-EX-1",
  "external_order_id": "external-order-id",
  "marketplace_order_number": "marketplace_order_number",
  "marketplace_note": "extra packaging",
  "line_items": [
    {
      "id": "b86fa12a-76fc-46f5-8a3e-bf39e7be4c4e",
      "line_item_id": "b86fa12a-76fc-46f5-8a3e-bf39e7be4c4e",
      "barcode": "453454334234",
      "sku": "product-84620",
      "name": "Super product",
      "quantity": 10,
      "line_item_note": "extra packaging",
      "productions": [
        {
          "production_key": "new-production-key",
          "created_at": "2025-01-22T16:48:25.616Z"
        }
      ]
    }
  ]
}

Delete order

delete

This method allows to delete a single order by its id.

Notes

Productions, additional productions and tasks are not in finished states (not “Done”, “Cancelled”, “From Stock”):

  • the system cancels all productions, tasks, additional tasks and additional components from this order with specified barcodes

  • Payment for task that are in “In progress” status should be calculated

  • Add flag “is deleted” to order info in all canceled productions.

  • Updates the deadline for the whole order according to the most short term deadline of the item in it.

  • Removes order details assosiated with this order from the list in “New production” and “Change order for production” pop-ups.

Productions, additional productions and tasks that are in finished states (not “Done”, “Cancelled”, “From Stock”) remain in the same status.

Authorizations
Path parameters
idstringRequired
Header parameters
x-tenant-idstring · uuidRequired

Tenant id (uuid v4)

Responses
200Success
application/json
delete
/api/v1/public/orders/{id}
DELETE /api/v1/public/orders/{id} HTTP/1.1
Host: 
x-api-key: YOUR_API_KEY
x-tenant-id: 123e4567-e89b-12d3-a456-426614174000
Accept: */*
200Success
{
  "id": "b86fa12a-76fc-46f5-8a3e-bf39e7be4c4e",
  "external_order_number": "external-order-number",
  "marketplace_order_number": "marketplace_order_number",
  "external_order_id": "external-order-id",
  "order_key": "order-key-123",
  "comment": "fragile",
  "to_stock": false,
  "is_deleted": false,
  "priority": "Medium",
  "client_id": "string",
  "counterparty_id": "string",
  "created_at": "2025-01-23T17:01:31.692Z"
}

Last updated