‹ Back to Dashboard

XLOG API Developer Guide

This guide describes the basic steps for interacting with the XLOG API. You will learn how to manage master data (articles, containers), submit packing orders, and retrieve the results.

All examples assume an API base URL of https://api.xlog.info/api/v1 and require an X-API-Key header for authentication.

1. Create Articles (Master Data)

Create or Update Articles

Before orders can be processed, the articles to be packed must be known to the system. This is done via the POST /articles endpoint. Multiple articles can be submitted in a single call.

An article requires a unique SKU, dimensions (in mm), and weight (in g).

Example Call (cURL)

curl -X POST 'https://api.xlog.info/api/v1/articles' \
-H 'Content-Type: application/json' \
-H 'X-API-Key: 18948856fdf2b63e09545ff3b07b03b207047ce82d40ab732b436cc905bcd915' \
-d '[
  {
    "sku": "ART-001",
    "company": "Company ABC",
    "length_mm": 200,
    "width_mm": 150,
    "height_mm": 100,
    "weight_g": 500
  },
  {
    "sku": "ART-002",
    "company": "Company ABC",
    "length_mm": 300,
    "width_mm": 250,
    "height_mm": 120,
    "weight_g": 1250
  }
]'

Expected Response

On success, the API returns HTTP status code 201 Created with no body.

2. List Articles

List All Articles

You can retrieve all articles currently stored in the system using the GET /articles endpoint.

Example Call (cURL)

curl -X GET 'https://api.xlog.info/api/v1/articles' \
-H 'X-API-Key: 18948856fdf2b63e09545ff3b07b03b207047ce82d40ab732b436cc905bcd915'

Example Response

The API returns a JSON array of article objects.

[
  {
    "sku": "ART-001",
    "company": "Company ABC",
    "length_mm": 200,
    "width_mm": 150,
    "height_mm": 100,
    "weight_g": 500
  },
  {
    "sku": "ART-002",
    "company": "Company ABC",
    "length_mm": 300,
    "width_mm": 250,
    "height_mm": 120,
    "weight_g": 1250
  }
]
3. Create Containers (Master Data)

Create or Update Containers

Parallel to articles, the available shipping containers (e.g., boxes) must be defined. This is done via the POST /containers endpoint.

Each container is defined by a unique ID, type, dimensions (in mm), and a maximum weight (in g).

Example Call (cURL)

curl -X POST 'https://api.xlog.info/api/v1/containers' \
-H 'Content-Type: application/json' \
-H 'X-API-Key: 18948856fdf2b63e09545ff3b07b03b207047ce82d40ab732b436cc905bcd915' \
-d '[
  {
    "id": "BOX-M",
    "type": "BOX",
    "name": "Medium Box",
    "length_mm": 350,
    "width_mm": 250,
    "height_mm": 150,
    "max_weight_g": 10000
  },
  {
    "id": "BOX-L",
    "type": "BOX",
    "name": "Large Box",
    "length_mm": 500,
    "width_mm": 400,
    "height_mm": 300,
    "max_weight_g": 25000
  }
]'

Expected Response

On success, the API returns HTTP status code 201 Created with no body.

4. List Containers

List All Containers

You can retrieve all container types currently stored in the system using the GET /containers endpoint.

Example Call (cURL)

curl -X GET 'https://api.xlog.info/api/v1/containers' \
-H 'X-API-Key: 18948856fdf2b63e09545ff3b07b03b207047ce82d40ab732b436cc905bcd915'

Example Response

The API returns a JSON array of container objects.

[
  {
    "id": "BOX-M",
    "type": "BOX",
    "name": "Medium Box",
    "length_mm": 350,
    "width_mm": 250,
    "height_mm": 150,
    "max_weight_g": 10000
  },
  {
    "id": "BOX-L",
    "type": "BOX",
    "name": "Large Box",
    "length_mm": 500,
    "width_mm": 400,
    "height_mm": 300,
    "max_weight_g": 25000
  }
]
5. Submit a Packing Order

Submit Order

A packing order is submitted via the POST /orders endpoint. The request must contain a list of items, specifying the SKU and quantity for each.

Processing is asynchronous. Upon submission, you will receive an order_id which you can use to poll for the status and result.

Example Call (cURL)

curl -X POST 'https://api.xlog.info/api/v1/orders' \
-H 'Content-Type: application/json' \
-H 'X-API-Key: 18948856fdf2b63e09545ff3b07b03b207047ce82d40ab732b436cc905bcd915' \
-d '{
  "items": [
    { "sku": "ART-001", "quantity": 3 },
    { "sku": "ART-002", "quantity": 1 }
  ]
}'

Expected Response (On Success)

The API responds with HTTP status code 202 Accepted and returns the order_id.

{
  "order_id": "a1b2c3d4-e5f6-7890-1234-567890abcdef",
  "status": "SUBMITTED"
}
6. Retrieve Order Results (Polling)

Get Order Status and Result

Since processing is asynchronous, the status of an order must be queried periodically (polled) using the GET /orders/{order_id} endpoint.

💡 Tip: Use jq, a command-line JSON processor, to format the output readability. The -s flag in cURL suppresses the progress meter.

Example Call (cURL with jq)

curl -s -X GET 'https://api.xlog.info/api/v1/orders/a1b2c3d4-e5f6-7890-1234-567890abcdef' \
-H 'X-API-Key: 18948856fdf2b63e09545ff3b07b03b207047ce82d40ab732b436cc905bcd915' | jq

Example Response (Status `COMPLETED`)

The formatted response will contain the result field with a list of solutions. Each solution represents one shipping container (e.g., a box).

{
  "id": "a1b2c3d4-e5f6-7890-1234-567890abcdef",
  "status": "COMPLETED",
  "request": {
    "items": [
      { "sku": "ART-001", "quantity": 3 },
      { "sku": "ART-002", "quantity": 1 }
    ]
  },
  "result": {
    "solutions": [
      {
        "loadingDeviceNumber": "BOX-L",
        "items": [
          {
            "sku": "ART-001",
            "quantity": 3,
            "position": { "x": 10, "y": 10, "z": 0 }
          },
          {
            "sku": "ART-002",
            "quantity": 1,
            "position": { "x": 10, "y": 170, "z": 0 }
          }
        ]
      }
    ]
  },
  "created_at": "2024-09-30T10:00:00Z",
  "updated_at": "2024-09-30T10:00:15Z"
}