Quickstart: Create a Document

Create your first product and warehouse document in under 10 minutes.

Prerequisites You need your API credentials (client_id and client_secret). Create them in the WMS app under Plugins → REST API → API Clients, or contact help@logistics-wms.com for help. You also need curl or any HTTP client installed.

Step 1: Get an Access Token

First, obtain an access token. See the Authentication Guide for full details and alternative methods.

Bash
TOKEN=$(curl -s -X POST https://app.logistics-wms.com/api/external/v1/auth/token \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET" \
  | jq -r '.access_token')

Step 2: Create a Product

Before creating a document with product lines, the products must exist in the system. Let's create a simple product.

curl
curl -X POST https://app.logistics-wms.com/api/external/v1/product \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "externalCode": "ERP-SKU-001",
    "description": "Wireless Bluetooth Headphones",
    "barcode": "5901234123457",
    "weight": 0.35,
    "volume": 0.002,
    "observations": "Fragile - handle with care"
  }'

Response

JSON Response (201 Created)
{
  "externalCode": "ERP-SKU-001",
  "description": "Wireless Bluetooth Headphones",
  "barcode": "5901234123457",
  "weight": 0.35,
  "volume": 0.002,
  "observations": "Fragile - handle with care"
}

Step 3: Create a Purchase Order Document

Now let's create a purchase order (incoming goods from a supplier) with the product we just registered.

curl
curl -X POST https://app.logistics-wms.com/api/external/v1/document \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "externalCode": "PO-2026-0001",
    "documentType": "PURCHASE_ORDER",
    "originCode": "SUPPLIER-ACME",
    "observations": "Expected delivery: 2026-04-20",
    "lines": [
      {
        "externalCode": "ERP-SKU-001",
        "quantity": 500,
        "lineNumber": 1
      }
    ]
  }'

Understanding the Request

Field Value Description
externalCode "PO-2026-0001" Your unique identifier for this document (from your ERP/system)
documentType "PURCHASE_ORDER" Incoming goods from a supplier. See Enum Reference for all types
originCode "SUPPLIER-ACME" Supplier or origin identifier
observations free text Optional notes for warehouse operators
lines[].externalCode "ERP-SKU-001" The product's external code (must already exist)
lines[].quantity 500 Expected quantity to receive
lines[].lineNumber 1 Line sequence number

Response

JSON Response (201 Created)
{
  "externalCode": "PO-2026-0001",
  "documentType": "PURCHASE_ORDER",
  "status": "OPEN",
  "originCode": "SUPPLIER-ACME",
  "observations": "Expected delivery: 2026-04-20",
  "lines": [
    {
      "externalCode": "ERP-SKU-001",
      "quantity": 500,
      "lineNumber": 1
    }
  ]
}

The document is now created with status OPEN. Warehouse operators will see it in the WMS and can begin processing the reception when the goods arrive.

Step 4: Verify the Document

Retrieve the document you just created to verify it was saved correctly.

curl
curl -X GET https://app.logistics-wms.com/api/external/v1/document/PO-2026-0001 \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json"
JSON Response (200 OK)
{
  "externalCode": "PO-2026-0001",
  "documentType": "PURCHASE_ORDER",
  "status": "OPEN",
  "originCode": "SUPPLIER-ACME",
  "observations": "Expected delivery: 2026-04-20",
  "lines": [
    {
      "externalCode": "ERP-SKU-001",
      "quantity": 500,
      "lineNumber": 1
    }
  ]
}
What happens next?
  • The document appears in the WMS for warehouse operators to process
  • When goods arrive, operators perform the reception in the WMS
  • Once the reception is closed, a webhook notification is sent to your system with the closing details
  • You can query stock levels at any time to see current inventory

Next Steps