Skip to content

Hype Custom tasks ​

Each task created for your platform is added to a queue. Poll the corresponding task endpoints regularly to retrieve it.

Supported task entities are items, categories, supplements, saloons, tables, orderRequests, orderDeliveryChannels, orderPaymentTypes, and orderRequestStatus.

After processing a task, send its status and result to that entity's task endpoint in a separate request.

Fetch tasks ​

Fetch the tasks, process them, and report each result to the same endpoint. HES then marks successfully processed tasks as complete.

The response is an array of task objects with this structure:

json
{
  "id": "...",
  "request": {
    ...
  },
  "status": 0,
  "meta": {
    "source_account": { ... }
  },
  "type": "..."
}

id is the task identifier needed when reporting its status and result.

request contains the data to process, corresponding to the request body in a REST API call. For GET tasks it carries the integration settings stored for your account, or [] when there are none; you do not need to act on it.

meta.source_account describes the Hype Server account the change came from: id, name, platform_id, platform_name, and platform_key.

type defines the requested operation.

  • GET: return all records of the requested entity type.
  • POST: create a record.
  • PUT: update a record.

HES does not currently send DELETE tasks. When a mapped record is deleted in Hype, you receive a PUT task for it with its fields reset to empty or zero values (for example "name": ""). Check for this case before applying a PUT.

status is always 0 when fetched, indicating a new, unprocessed task.

Items ​

GET /tasks/hype-custom/items

The request above returns tasks such as these:

json
[
  {
    "id": "9a101f76-f1c8-47c2-a19f-259150bb62e0",
    "request": {
      "name": "Маргарита 20",
      "categoryId": 31,
      "price": 4.33,
      "preparationTime": 20,
      "barCode": "812345679",
      "modifiers": [],
      "quantity": 1,
      "active": true
    },
    "status": 0,
    "meta": {
      "source_account": {
        "id": "a0fa1fe5-feda-4753-9f23-691343e3828c",
        "name": "Local",
        "platform_id": "4d410b0e-ee37-497e-8362-478a383d68ee",
        "platform_name": "Hype Server",
        "platform_key": "hype-server"
      }
    },
    "type": "POST"
  },
  {
    "id": "9a101f76-f1c8-47c2-a19f-439150bb58ab",
    "request": {
      "id": "87001",
      "name": "Coca Cola",
      "categoryId": 31,
      "price": 2.5,
      "preparationTime": 0,
      "barCode": "712345689",
      "modifiers": [],
      "supplements": [],
      "quantity": 1,
      "active": true
    },
    "status": 0,
    "meta": {
      "source_account": {
        "id": "a0fa1fe5-feda-4753-9f23-691343e3828c",
        "name": "Local",
        "platform_id": "4d410b0e-ee37-497e-8362-478a383d68ee",
        "platform_name": "Hype Server",
        "platform_key": "hype-server"
      }
    },
    "type": "PUT"
  }
]

The first task, with ID 9a101f76-f1c8-47c2-a19f-259150bb62e0, asks you to create a new item. POST tasks never contain id; you assign it and return it in your result. Item quantity is always 1 and is not stock.

The second task updates item 87001. This is the item's ID in your platform, which is integrating with HES.

Categories ​

GET /tasks/hype-custom/categories

json
[
  {
    "id": "9a101f76-f1c8-47c2-a19f-259150bb62e0",
    "request": {
      "name": "Сандвичи",
      "order": 1
    },
    "status": 0,
    "meta": {
      "source_account": {
        "id": "a0fa1fe5-feda-4753-9f23-691343e3828c",
        "name": "Local",
        "platform_id": "4d410b0e-ee37-497e-8362-478a383d68ee",
        "platform_name": "Hype Server",
        "platform_key": "hype-server"
      }
    },
    "type": "POST"
  },
  {
    "id": "9a101f76-f1c8-47c2-a19f-439150bb58ab",
    "request": {
      "name": "Пици",
      "order": 2
    },
    "status": 0,
    "meta": {
      "source_account": {
        "id": "a0fa1fe5-feda-4753-9f23-691343e3828c",
        "name": "Local",
        "platform_id": "4d410b0e-ee37-497e-8362-478a383d68ee",
        "platform_name": "Hype Server",
        "platform_key": "hype-server"
      }
    },
    "type": "POST"
  },
  {
    "id": "9a101f76-f1c8-47c2-a19f-489150bb62b1",
    "request": {
      "id": 234,
      "name": "Бира",
      "order": 3
    },
    "status": 0,
    "meta": {
      "source_account": {
        "id": "a0fa1fe5-feda-4753-9f23-691343e3828c",
        "name": "Local",
        "platform_id": "4d410b0e-ee37-497e-8362-478a383d68ee",
        "platform_name": "Hype Server",
        "platform_key": "hype-server"
      }
    },
    "type": "PUT"
  }
]

Order requests ​

GET /tasks/hype-custom/orderRequests

When Hype changes an order status, HES creates a task with the mapped order ID and status. Other fields can be retained from earlier stored order data. Process the status change; do not treat additional fields as a fresh order snapshot. This example shows only the fields needed by the status handler. See the API reference.

json
[
  {
    "id": "9a101f76-f1c8-47c2-a19f-259150bb62e0",
    "request": {
      "id": 1,
      "status": {
        "id": 2,
        "name": "Приета"
      }
    },
    "status": 0,
    "meta": {
      "source_account": {
        "id": "a0fa1fe5-feda-4753-9f23-691343e3828c",
        "name": "Local",
        "platform_id": "4d410b0e-ee37-497e-8362-478a383d68ee",
        "platform_name": "Hype Server",
        "platform_key": "hype-server"
      }
    },
    "type": "PUT"
  }
]

Order delivery channels ​

GET /tasks/hype-custom/orderDeliveryChannels

This resource normally receives GET tasks, asking for all delivery-channel records in your platform.

json
[
  {
    "id": "9a101f76-f1c8-47c2-a19f-259150bb62e0",
    "request": [],
    "status": 0,
    "meta": {
      "source_account": {
        "id": "a0fa1fe5-feda-4753-9f23-691343e3828c",
        "name": "Local",
        "platform_id": "4d410b0e-ee37-497e-8362-478a383d68ee",
        "platform_name": "Hype Server",
        "platform_key": "hype-server"
      }
    },
    "type": "GET"
  }
]

Return your delivery channels as an array in the task's response. The create delivery channel webhook can also supply values to HES. Pair these values manually in Hype Server after activation; see the integration flow.

Order payment types ​

GET /tasks/hype-custom/orderPaymentTypes

Payment types use GET tasks in the same way as delivery channels.

json
[
  {
    "id": "9a101f76-f1c8-47c2-a19f-259150bb62e0",
    "request": [],
    "status": 0,
    "meta": {
      "source_account": {
        "id": "a0fa1fe5-feda-4753-9f23-691343e3828c",
        "name": "Local",
        "platform_id": "4d410b0e-ee37-497e-8362-478a383d68ee",
        "platform_name": "Hype Server",
        "platform_key": "hype-server"
      }
    },
    "type": "GET"
  }
]

Return your payment types as an array in response. The create payment type webhook can also supply these values for later manual mapping.

Order request statuses ​

GET /tasks/hype-custom/orderRequestStatus

Order statuses use GET tasks in the same way as delivery channels and payment types.

json
[
  {
    "id": "9a101f76-f1c8-47c2-a19f-259150bb62e0",
    "request": [],
    "status": 0,
    "meta": {
      "source_account": {
        "id": "a0fa1fe5-feda-4753-9f23-691343e3828c",
        "name": "Local",
        "platform_id": "4d410b0e-ee37-497e-8362-478a383d68ee",
        "platform_name": "Hype Server",
        "platform_key": "hype-server"
      }
    },
    "type": "GET"
  }
]

Return your order statuses as an array in response. The create order status webhook can also supply these values for later manual mapping.

Report task results ​

After retrieving and processing a task, notify HES of the result. Send a PUT request to the corresponding entity endpoint with a payload like this:

json
[
  {
    "entity_task_id":"9a101f76-f1c8-47c2-a19f-259150bb62e0",
    "response":{ ... },
    "status": 200
  }
]

entity_task_id is the ID of the task received from HES.

response is the processing result. For a GET task, return an array of records; HES uses it during synchronization. For a successful POST/PUT task, return your resulting entity with its id.

status is the task's processing result code, with the same meaning as standard HTTP status codes.

Hype Exchange Service API