Assembly API

Manage assembly documents — retrieval, creation, modification, closing and item-level consumed parts recording

Base URL

https://{tenant}.logzi.com/api/assembly/

Every request returns a JSON response. On success result.code == 1, on error result.code == 0.

GET /api/assembly/get

Retrieve a single assembly document by identifier, including its consumed parts.

Query parameters

Parameter Type Required Description
id int Unique identifier of the assembly document

Example request

GET /api/assembly/get?id=5
X-API-KEY: {your_api_key}

Example response

{
  "result": { "code": 1, "message": "success" },
  "data": {
    "id": 5,
    "identify": "ASM-2024-0005",
    "date_create": "2024-05-08 09:00:00",
    "status_id": 1,
    "store_id": 1,
    "product_id": 42,
    "quantity": 10,
    "company_user_name": "Kovács Péter",
    "item": [
      {
        "product_id": 12,
        "quantity": 20,
        "store_id": 1,
        "store_locality_id": null
      }
    ]
  }
}
GET /api/assembly/list

Paginated retrieval of the assembly document list with filtering options.

Query parameters

Parameter Type Required Description
list_offset int Pagination offset (default: 0)
list_condition[identify] string Filter by identifier (LIKE)
list_condition[status_id] int Filter by status (1=open, 2=closed)
list_condition[date_create_from] date Creation date — from (YYYY-MM-DD)
list_condition[date_create_to] date Creation date — to (YYYY-MM-DD)

Example request

GET /api/assembly/list?list_offset=0&list_condition[status_id]=1
X-API-KEY: {your_api_key}

Example response

{
  "result": { "code": 1, "message": "success" },
  "data": [
    {
      "id": 5,
      "identify": "ASM-2024-0005",
      "date_create": "2024-05-08",
      "status_name": "Nyitott",
      "product_id": 42,
      "quantity": 10,
      "company_user_name": "Kovács Péter"
    }
  ],
  "params": {
    "list_count": 10,
    "list_offset": 0,
    "list_all": 3
  }
}
POST /api/assembly/save

Create or update an assembly document. You must specify the destination warehouse, the assembled product, the quantity produced, and the array of consumed parts. For a new document use data[id] = 0.

POST fields — data object

Field Type Required Description
id int 0 = new document, >0 = update
company_id int Company identifier
company_user_id int Responsible employee ID
company_address_id int Company site ID
store_id int Destination warehouse ID (where the assembled product is received)
product_id int Identifier of the assembled (finished) product
quantity decimal Quantity produced
comment_bottom string Internal comment
item array Array of consumed parts — at least one item is required (see below)

Item fields — data[item][] (consumed parts)

Field Type Required Description
product_id int Identifier of the consumed part (product)
quantity decimal Quantity consumed
store_id int Source warehouse ID (from which the part is withdrawn)
store_locality_id int Storage location identifier
remove int 1 = delete the item during update

POST fields — params object (optional)

Field Type Required Description
close int 1 = close automatically after saving

Example request

POST /api/assembly/save
X-API-KEY: {your_api_key}
Content-Type: application/json

{
  "data": {
    "id": 0,
    "company_id": 1,
    "company_user_id": 3,
    "store_id": 1,
    "product_id": 42,
    "quantity": 10,
    "item": [
      {
        "product_id": 12,
        "quantity": 20,
        "store_id": 1
      },
      {
        "product_id": 15,
        "quantity": 10,
        "store_id": 1,
        "store_locality_id": 3
      }
    ]
  },
  "params": {
    "close": 0
  }
}

Example response

{
  "result": { "code": 1, "message": "success" },
  "data": {
    "id": 6,
    "identify": "ASM-2024-0006"
  }
}
POST /api/assembly/delete

Delete an assembly document. Only an open document (status_id = 1) can be deleted.

POST fields — data object

Field Type Required Description
receipt_id int Identifier of the document to delete

Example request

POST /api/assembly/delete
X-API-KEY: {your_api_key}
Content-Type: application/json

{
  "data": {
    "receipt_id": 5
  }
}

Example response

{
  "result": { "code": 1, "message": "success" },
  "data": {}
}
POST /api/assembly/close

Close an open assembly document. Closing performs the stock movement: it deducts the consumed parts and credits the assembled product to the destination warehouse. Only a document with status_id = 1 (open) can be closed.

POST fields — data object

Field Type Required Description
receipt_id int Identifier of the document to close

Example request

POST /api/assembly/close
X-API-KEY: {your_api_key}
Content-Type: application/json

{
  "data": {
    "receipt_id": 5
  }
}

Example response

{
  "result": { "code": 1, "message": "success" },
  "data": {}
}

Get in touch with us

Interested in our software? Feel free to write to us!

Need help?

If you can't find the answer and need assistance

Create your account now,
pay later!

Try it free for 3 days, no risk, no obligation!