API Gateway — Overview

API ini digunakan oleh client/partner untuk mengirim data Order dan ASN (Advanced Shipping Notice) ke sistem LOZY. Semua request harus menggunakan API key untuk autentikasi.

Protocol
HTTPS
Format
JSON
Auth
API Key (Header)
Rate Limit
100 req/min

Authentication

Semua request harus menyertakan API key di header:

X-API-Key: your_api_key_here

API key diberikan oleh tim LOZY saat onboarding. Jika API key invalid atau tidak disertakan, response:

HTTP/1.1 401 Unauthorized

{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Invalid or missing API key"
  }
}
Jangan share API key ke pihak lain. Jika bocor, hubungi tim LOZY untuk regenerate.

Base URL

ProductionNeed Confirm
Staginghttps://dummy-api-staging.lozy.co.id/v1

Error Handling

Semua error response mengikuti format yang sama:

{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Human-readable error message",
    "details": [
      {"field": "items[0].sku", "message": "SKU is required"}
    ]
  }
}
Error Codes
HTTP StatusCodeDeskripsi
400VALIDATION_ERRORRequest body invalid
401UNAUTHORIZEDAPI key invalid/missing
404NOT_FOUNDResource tidak ditemukan
409DUPLICATEData sudah ada (conflict)
422UNPROCESSABLEData valid tapi tidak bisa diproses
429RATE_LIMITEDToo many requests
500INTERNAL_ERRORServer error

Order API

POST /v1/orders

Buat order baru di sistem LOZY.

Request Headers
Content-Type: application/json
X-API-Key: your_api_key_here
Request Body
FieldTypeRequiredDeskripsi
order_idstringYesID unik order dari sistem kamu
marketplacestringYesshopee, tiktok, lazada, zalora, tokopedia, manual
marketplace_order_idstringNoOrder ID dari marketplace
statusstringYesnew, processing, packed, shipped, delivered, cancelled
customerobjectYesData customer (lihat di bawah)
itemsarrayYesItem order (min 1)
shippingobjectNoInfo pengiriman
paymentobjectNoInfo pembayaran
notesstringNoCatatan order
warehouse_codestringNoKode gudang tujuan
customer object
FieldTypeRequiredDeskripsi
namestringYesNama penerima
phonestringYesNo. telepon
emailstringNoEmail
addressobjectYesAlamat pengiriman
customer.address object
FieldTypeRequired
streetstringYes
districtstringNo
citystringYes
provincestringYes
postal_codestringYes
countrystringNo
items[] object
FieldTypeRequiredDeskripsi
skustringYesSKU produk
namestringYesNama produk
qtyintegerYesJumlah
pricenumberYesHarga per item
totalnumberNoTotal (qty × price)
weight_gramnumberNoBerat per item (gram)
variantstringNoVarian (size/color/etc)
Example Request
curl -X POST https://api.lozy.co.id/v1/orders \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your_api_key_here" \
  -d '{
    "order_id": "ORD-2024-00123",
    "marketplace": "shopee",
    "marketplace_order_id": "240115ABCDEF",
    "status": "new",
    "customer": {
      "name": "John Doe",
      "phone": "08123456789",
      "email": "john@example.com",
      "address": {
        "street": "Jl. Sudirman No. 1, RT 01/RW 02",
        "district": "Setiabudi",
        "city": "Jakarta Selatan",
        "province": "DKI Jakarta",
        "postal_code": "12190",
        "country": "ID"
      }
    },
    "items": [
      {
        "sku": "SKU-BLK-L-001",
        "name": "Kaos Polos Hitam L",
        "qty": 2,
        "price": 75000,
        "total": 150000,
        "weight_gram": 200,
        "variant": "Hitam / L"
      },
      {
        "sku": "SKU-WHT-M-002",
        "name": "Kaos Polos Putih M",
        "qty": 1,
        "price": 70000,
        "total": 70000,
        "weight_gram": 200,
        "variant": "Putih / M"
      }
    ],
    "shipping": {
      "courier": "JNE",
      "service": "REG",
      "cost": 15000,
      "tracking_number": null
    },
    "payment": {
      "method": "marketplace",
      "total_amount": 235000,
      "currency": "IDR"
    },
    "notes": "Tolong packing bubble wrap",
    "warehouse_code": "WH-JKT-01"
  }'
Response 201 Created
{
  "success": true,
  "data": {
    "id": "lozy_ord_abc123",
    "order_id": "ORD-2024-00123",
    "marketplace": "shopee",
    "status": "new",
    "items_count": 2,
    "total_amount": 235000,
    "created_at": "2024-01-15T10:30:00Z"
  },
  "message": "Order created successfully"
}

PUT /v1/orders/:order_id

Update order yang sudah ada. Hanya kirim field yang berubah.

curl -X PUT https://api.lozy.co.id/v1/orders/ORD-2024-00123 \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your_api_key_here" \
  -d '{
    "status": "processing",
    "shipping": {
      "tracking_number": "JNE1234567890"
    }
  }'
Response 200 OK
{
  "success": true,
  "data": {
    "order_id": "ORD-2024-00123",
    "status": "processing",
    "updated_at": "2024-01-15T14:00:00Z"
  },
  "message": "Order updated successfully"
}

GET /v1/orders/:order_id

Ambil detail order.

curl -H "X-API-Key: your_api_key_here" \
  https://api.lozy.co.id/v1/orders/ORD-2024-00123
Response 200 OK
{
  "success": true,
  "data": {
    "id": "lozy_ord_abc123",
    "order_id": "ORD-2024-00123",
    "marketplace": "shopee",
    "marketplace_order_id": "240115ABCDEF",
    "status": "processing",
    "customer": { "name": "John Doe", "phone": "08123456789", ... },
    "items": [ ... ],
    "shipping": { "courier": "JNE", "tracking_number": "JNE1234567890" },
    "payment": { "total_amount": 235000 },
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-15T14:00:00Z"
  }
}

GET /v1/orders

List orders dengan filter dan pagination.

Query ParamTypeDeskripsi
statusstringFilter by status
marketplacestringFilter by marketplace
date_fromstringFrom date (ISO format)
date_tostringTo date (ISO format)
pageintegerHalaman (default: 1)
limitintegerPer halaman (default: 20, max: 100)
curl -H "X-API-Key: your_api_key_here" \
  "https://api.lozy.co.id/v1/orders?status=new&marketplace=shopee&page=1&limit=20"

POST /v1/orders/:order_id/cancel

Cancel order. Hanya bisa di-cancel jika status masih new atau processing.

curl -X POST https://api.lozy.co.id/v1/orders/ORD-2024-00123/cancel \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your_api_key_here" \
  -d '{
    "reason": "Customer requested cancellation",
    "cancelled_by": "customer"
  }'
Response 200 OK
{
  "success": true,
  "data": { "order_id": "ORD-2024-00123", "status": "cancelled" },
  "message": "Order cancelled successfully"
}
Order yang sudah shipped atau delivered tidak bisa di-cancel. Response: 422 Unprocessable.

ASN API (Advanced Shipping Notice)

ASN digunakan untuk memberitahu gudang LOZY bahwa akan ada barang masuk dari supplier/partner.

POST /v1/asn

Buat ASN baru.

Request Body
FieldTypeRequiredDeskripsi
asn_numberstringYesNomor ASN unik dari sistem kamu
reference_numberstringNoNomor PO/referensi
warehouse_codestringYesKode gudang tujuan
supplierobjectYesInfo supplier
expected_arrivalstringYesTanggal perkiraan tiba (ISO date: 2024-01-15)
itemsarrayYesItem yang dikirim (min 1)
shippingobjectNoInfo pengiriman
notesstringNoCatatan
supplier object
FieldTypeRequired
codestringYes
namestringYes
contactstringNo
phonestringNo
items[] object
FieldTypeRequiredDeskripsi
skustringYesSKU produk
namestringYesNama produk
qty_expectedintegerYesJumlah yang diharapkan
unitstringNoSatuan (default: pcs)
batch_numberstringNoNomor batch
expiry_datestringNoTanggal kadaluarsa
cost_pricenumberNoHarga beli per item
shipping object (opsional)
FieldTypeDeskripsi
courierstringNama kurir/ekspedisi
tracking_numberstringNo. resi
shipped_atstringWaktu pengiriman (ISO)
Example Request
curl -X POST https://api.lozy.co.id/v1/asn \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your_api_key_here" \
  -d '{
    "asn_number": "ASN-2024-00045",
    "reference_number": "PO-2024-100",
    "warehouse_code": "WH-JKT-01",
    "supplier": {
      "code": "SUP-001",
      "name": "PT Supplier Utama",
      "contact": "Budi",
      "phone": "08111222333"
    },
    "expected_arrival": "2024-01-20",
    "items": [
      {
        "sku": "SKU-BLK-L-001",
        "name": "Kaos Polos Hitam L",
        "qty_expected": 200,
        "unit": "pcs",
        "batch_number": "BATCH-JAN-001",
        "cost_price": 35000
      },
      {
        "sku": "SKU-WHT-M-002",
        "name": "Kaos Polos Putih M",
        "qty_expected": 150,
        "unit": "pcs",
        "batch_number": "BATCH-JAN-001",
        "cost_price": 33000
      }
    ],
    "shipping": {
      "courier": "JNE Trucking",
      "tracking_number": "JNECARGO123456",
      "shipped_at": "2024-01-18T09:00:00Z"
    },
    "notes": "Batch produksi Januari 2024"
  }'
Response 201 Created
{
  "success": true,
  "data": {
    "id": "lozy_asn_xyz789",
    "asn_number": "ASN-2024-00045",
    "warehouse_code": "WH-JKT-01",
    "status": "pending",
    "items_count": 2,
    "total_qty_expected": 350,
    "expected_arrival": "2024-01-20",
    "created_at": "2024-01-15T08:00:00Z"
  },
  "message": "ASN created successfully"
}

PUT /v1/asn/:asn_number

Update ASN. Bisa update items, shipping info, expected arrival, dll.

curl -X PUT https://api.lozy.co.id/v1/asn/ASN-2024-00045 \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your_api_key_here" \
  -d '{
    "expected_arrival": "2024-01-22",
    "shipping": {
      "tracking_number": "JNECARGO999999",
      "shipped_at": "2024-01-19T10:00:00Z"
    },
    "notes": "Terlambat 2 hari karena cuaca"
  }'
Response 200 OK
{
  "success": true,
  "data": { "asn_number": "ASN-2024-00045", "status": "in_transit", "updated_at": "..." },
  "message": "ASN updated successfully"
}

GET /v1/asn/:asn_number

Ambil detail ASN termasuk status penerimaan di gudang.

curl -H "X-API-Key: your_api_key_here" \
  https://api.lozy.co.id/v1/asn/ASN-2024-00045
Response 200 OK
{
  "success": true,
  "data": {
    "id": "lozy_asn_xyz789",
    "asn_number": "ASN-2024-00045",
    "reference_number": "PO-2024-100",
    "warehouse_code": "WH-JKT-01",
    "status": "received",
    "supplier": { "code": "SUP-001", "name": "PT Supplier Utama" },
    "expected_arrival": "2024-01-22",
    "actual_arrival": "2024-01-22T09:30:00Z",
    "items": [
      {
        "sku": "SKU-BLK-L-001",
        "name": "Kaos Polos Hitam L",
        "qty_expected": 200,
        "qty_received": 198,
        "qty_damaged": 2,
        "status": "received"
      },
      {
        "sku": "SKU-WHT-M-002",
        "name": "Kaos Polos Putih M",
        "qty_expected": 150,
        "qty_received": 150,
        "qty_damaged": 0,
        "status": "received"
      }
    ],
    "shipping": { "courier": "JNE Trucking", "tracking_number": "JNECARGO999999" },
    "received_by": "Ahmad (Staff Gudang)",
    "created_at": "2024-01-15T08:00:00Z",
    "updated_at": "2024-01-22T09:30:00Z"
  }
}
ASN Status Flow
pending → in_transit → arrived → receiving → received → closed
                                                         ↘ partially_received
StatusDeskripsi
pendingASN dibuat, belum dikirim
in_transitBarang dalam perjalanan
arrivedBarang tiba di gudang, belum di-check
receivingSedang proses penerimaan/QC
receivedSemua item diterima
partially_receivedSebagian item diterima (ada yang kurang/rusak)
closedASN ditutup/final

GET /v1/asn

List ASN dengan filter.

Query ParamTypeDeskripsi
statusstringFilter by status
warehouse_codestringFilter by warehouse
supplier_codestringFilter by supplier
date_fromstringExpected arrival from
date_tostringExpected arrival to
pageintegerHalaman (default: 1)
limitintegerPer halaman (max: 100)
curl -H "X-API-Key: your_api_key_here" \
  "https://api.lozy.co.id/v1/asn?status=pending&warehouse_code=WH-JKT-01"

POST /v1/asn/:asn_number/confirm-received

Konfirmasi penerimaan barang di gudang. Kirim qty yang benar-benar diterima per item.

curl -X POST https://api.lozy.co.id/v1/asn/ASN-2024-00045/confirm-received \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your_api_key_here" \
  -d '{
    "received_by": "Ahmad - Staff Gudang",
    "received_at": "2024-01-22T09:30:00Z",
    "items": [
      {
        "sku": "SKU-BLK-L-001",
        "qty_received": 198,
        "qty_damaged": 2,
        "damage_notes": "2 pcs kotor terkena air"
      },
      {
        "sku": "SKU-WHT-M-002",
        "qty_received": 150,
        "qty_damaged": 0
      }
    ],
    "notes": "Overall kondisi baik"
  }'
Response 200 OK
{
  "success": true,
  "data": {
    "asn_number": "ASN-2024-00045",
    "status": "partially_received",
    "total_expected": 350,
    "total_received": 348,
    "total_damaged": 2,
    "discrepancy": -2
  },
  "message": "ASN receiving confirmed"
}
Jika total_received === total_expected, status otomatis jadi received.
Jika ada selisih, status jadi partially_received.

Vendor API

POST /v1/vendors

Buat vendor/supplier baru di sistem LOZY.

Request Headers
Content-Type: application/json
X-API-Key: your_api_key_here
Request Body
FieldTypeRequiredDeskripsi
codestringYesKode unik vendor (max 100 char)
namestringYesNama vendor/supplier
descriptionstringNoDeskripsi vendor
Example Request
curl -X POST https://api.lozy.co.id/v1/vendors \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your_api_key_here" \
  -d '{
    "code": "SUP-001",
    "name": "PT Supplier Utama",
    "description": "Supplier kaos polos dan basic wear"
  }'
Response 201 Created
{
  "success": true,
  "data": {
    "code": "SUP-001",
    "name": "PT Supplier Utama",
    "description": "Supplier kaos polos dan basic wear",
    "created_at": "2024-01-10T08:00:00Z"
  },
  "message": "Vendor created successfully"
}
Error: Duplicate Code 409
{
  "success": false,
  "error": {
    "code": "DUPLICATE",
    "message": "Vendor with code 'SUP-001' already exists"
  }
}

Product / Item API

POST /v1/products

Buat product/item baru di sistem LOZY.

Request Headers
Content-Type: application/json
X-API-Key: your_api_key_here
Request Body
FieldTypeRequiredDeskripsi
skustringYesSKU unik produk (max 50 char)
namestringYesNama produk
parentstringNoParent SKU (untuk variant grouping)
descriptionstringNoDeskripsi produk
category_idstringNoID kategori produk
is_snbooleanNoApakah produk ini punya serial number tracking (default: false)
is_expiredbooleanNoApakah produk ini punya expiry date tracking (default: false)
uomstringNoUnit of measure (default: PCS). Contoh: PCS, BOX, KG, SET
temperature_zonestringNoZona suhu penyimpanan. Contoh: AMBIENT, CHILLED, FROZEN
Example Request — Produk standar
curl -X POST https://api.lozy.co.id/v1/products \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your_api_key_here" \
  -d '{
    "sku": "SKU-BLK-L-001",
    "name": "Kaos Polos Hitam L",
    "parent": "SKU-BLK",
    "description": "Kaos polos cotton combed 30s warna hitam ukuran L",
    "category_id": "CAT-KAOS",
    "is_sn": false,
    "is_expired": false,
    "uom": "PCS",
    "temperature_zone": "AMBIENT"
  }'
Example Request — Produk dengan serial number
curl -X POST https://api.lozy.co.id/v1/products \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your_api_key_here" \
  -d '{
    "sku": "ELEC-PHONE-001",
    "name": "Smartphone XYZ Pro",
    "description": "Smartphone flagship dengan IMEI tracking",
    "category_id": "CAT-ELECTRONICS",
    "is_sn": true,
    "is_expired": false,
    "uom": "PCS"
  }'
Example Request — Produk dengan expiry
curl -X POST https://api.lozy.co.id/v1/products \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your_api_key_here" \
  -d '{
    "sku": "FOOD-MILK-001",
    "name": "Susu UHT 1L",
    "description": "Susu UHT rasa coklat 1 liter",
    "category_id": "CAT-FOOD",
    "is_sn": false,
    "is_expired": true,
    "uom": "PCS",
    "temperature_zone": "CHILLED"
  }'
Response 201 Created
{
  "success": true,
  "data": {
    "sku": "SKU-BLK-L-001",
    "name": "Kaos Polos Hitam L",
    "parent": "SKU-BLK",
    "description": "Kaos polos cotton combed 30s warna hitam ukuran L",
    "category_id": "CAT-KAOS",
    "is_sn": false,
    "is_expired": false,
    "uom": "PCS",
    "temperature_zone": "AMBIENT",
    "created_at": "2024-01-10T08:00:00Z"
  },
  "message": "Product created successfully"
}
Error: Duplicate SKU 409
{
  "success": false,
  "error": {
    "code": "DUPLICATE",
    "message": "Product with SKU 'SKU-BLK-L-001' already exists"
  }
}
Catatan:
  • is_sn: true → Sistem akan track serial number per unit saat inbound (ASN receiving)
  • is_expired: true → Sistem akan track tanggal kadaluarsa per batch saat inbound
  • temperature_zone → Menentukan lokasi penyimpanan di gudang (zona suhu)
  • parent → Grouping variant. Misal SKU-BLK-L, SKU-BLK-M, SKU-BLK-S punya parent SKU-BLK

Finance API

GET /v1/finance/orders

Ambil data finance transaksi order yang sudah completed. Data ini bisa digunakan untuk rekonsiliasi keuangan, laporan penjualan, dan analisis profit.

Request Headers
X-API-Key: your_api_key_here
Query Parameters
ParamTypeRequiredDeskripsi
date_fromstringNoFilter completion date from (ISO: 2026-07-21)
date_tostringNoFilter completion date to
order_sourcestringNoSHOPEE, TIKTOK, LAZADA, ZALORA
payment_statusstringNoPAID, PENDING, REFUNDED
pageintegerNoHalaman (default: 1)
limitintegerNoPer halaman (default: 10, max: 100)
Example Request
curl -H "X-API-Key: your_api_key_here" \
  "https://api.lozy.co.id/v1/finance/orders?date_from=2026-07-21&date_to=2026-07-21&order_source=SHOPEE&page=1&limit=10"
Response 200 OK
{
  "code": 200,
  "success": true,
  "data": [
    {
      "finance_transaction_id": "FIN-ORD-20260721-0001",
      "order_id": "ORD-20260721-000001",
      "external_order_no": "240115ABCDEF",
      "order_source": "SHOPEE",
      "order_date": "2026-07-21T10:00:00Z",
      "completion_date": "2026-07-21T14:30:00Z",
      "currency": "IDR",
      "exchange_rate": 1,
      "customer_info": {
        "customer_id": "CUST-001",
        "customer_name": "John Doe",
        "billing_city": "Jakarta Selatan"
      },
      "summary_amounts": {
        "subtotal": 150000,
        "discount_amount": 10000,
        "tax_amount": 0,
        "shipping_cost": 15000,
        "marketplace_admin_fee": 3000,
        "grand_total": 155000
      },
      "payment_info": {
        "payment_method": "COD",
        "payment_status": "PAID"
      },
      "items": [
        {
          "item_id": "ITEM-101",
          "sku": "SKU-001",
          "item_name": "Kaos Polos Hitam L",
          "qty": 2,
          "unit_price": 75000,
          "line_discount": 5000,
          "line_total": 145000,
          "cogs_per_unit": 35000
        }
      ]
    },
    {
      "finance_transaction_id": "FIN-ORD-20260721-0005",
      "order_id": "ORD-20260721-000005",
      "external_order_no": "260608H7UFS47R",
      "order_source": "SHOPEE",
      "order_date": "2026-07-21T11:30:00Z",
      "completion_date": "2026-07-21T18:00:00Z",
      "currency": "IDR",
      "exchange_rate": 1,
      "customer_info": {
        "customer_id": "CUST-005",
        "customer_name": "Rina Wati",
        "billing_city": "Tasikmalaya"
      },
      "summary_amounts": {
        "subtotal": 447000,
        "discount_amount": 60000,
        "tax_amount": 0,
        "shipping_cost": 6500,
        "marketplace_admin_fee": 7000,
        "grand_total": 393500
      },
      "payment_info": {
        "payment_method": "PayLater",
        "payment_status": "PAID"
      },
      "items": [
        {
          "item_id": "ITEM-501",
          "sku": "Y107021",
          "item_name": "Lesti Instan Bandana Oatmeal",
          "qty": 1,
          "unit_price": 149000,
          "line_discount": 20000,
          "line_total": 129000,
          "cogs_per_unit": 55000
        },
        {
          "item_id": "ITEM-502",
          "sku": "Y107022",
          "item_name": "Lesti Instan Bandana Blue Grey",
          "qty": 1,
          "unit_price": 149000,
          "line_discount": 20000,
          "line_total": 129000,
          "cogs_per_unit": 55000
        }
      ]
    }
  ],
  "pagination": {
    "current_page": 1,
    "total_pages": 2,
    "total_records": 20,
    "limit": 10,
    "offset": 0
  }
}
Response Fields
FieldTypeDeskripsi
finance_transaction_idstringID unik transaksi finance
order_idstringOrder ID internal LOZY
external_order_nostringOrder ID dari marketplace
order_sourcestringMarketplace asal
order_datedatetimeTanggal order dibuat
completion_datedatetimeTanggal order completed/delivered
currencystringMata uang
exchange_ratenumberKurs (1 untuk IDR)
customer_info
FieldTypeDeskripsi
customer_idstringID customer
customer_namestringNama customer
billing_citystringKota billing
summary_amounts
FieldTypeDeskripsi
subtotalnumberTotal harga item sebelum diskon
discount_amountnumberTotal diskon
tax_amountnumberPajak
shipping_costnumberOngkos kirim
marketplace_admin_feenumberFee admin marketplace
grand_totalnumberTotal akhir yang diterima
items[]
FieldTypeDeskripsi
item_idstringID item
skustringSKU produk
item_namestringNama produk
qtyintegerJumlah
unit_pricenumberHarga per unit
line_discountnumberDiskon per baris
line_totalnumberTotal baris setelah diskon
cogs_per_unitnumberHPP per unit (Cost of Goods Sold)
pagination
FieldTypeDeskripsi
current_pageintegerHalaman saat ini
total_pagesintegerTotal halaman
total_recordsintegerTotal record
limitintegerPer halaman
offsetintegerOffset
Catatan:
  • Hanya order yang sudah completed yang muncul di finance API
  • cogs_per_unit digunakan untuk menghitung gross profit per item
  • marketplace_admin_fee adalah potongan dari marketplace (service fee, commission, dll)
  • Gunakan grand_total - (cogs_per_unit × qty) untuk estimasi net profit per order

Inventory API

GET /v1/inventory/stock

Cek stok produk di gudang. Bisa filter berdasarkan SKU, location, atau ambil semua.

Request Headers
X-API-Key: your_api_key_here
Query Parameters
ParamTypeRequiredDeskripsi
skustringNoFilter by SKU (exact match atau partial: SKU-001)
locationstringNoFilter by lokasi/racking (contoh: A-01-01)
warehouse_codestringNoFilter by gudang
pageintegerNoHalaman (default: 1)
limitintegerNoPer halaman (default: 50, max: 500)
Limit: Maksimal 500 record per request. Jika butuh lebih, gunakan pagination.
Example: Get all stock
curl -H "X-API-Key: your_api_key_here" \
  "https://api.lozy.co.id/v1/inventory/stock?page=1&limit=50"
Example: Search by SKU
curl -H "X-API-Key: your_api_key_here" \
  "https://api.lozy.co.id/v1/inventory/stock?sku=L020003"
Example: Search by Location
curl -H "X-API-Key: your_api_key_here" \
  "https://api.lozy.co.id/v1/inventory/stock?location=A-01-01"
Example: Combine filters
curl -H "X-API-Key: your_api_key_here" \
  "https://api.lozy.co.id/v1/inventory/stock?sku=L020003&warehouse_code=WHBANDUNG&page=1&limit=100"
Response 200 OK
{
  "code": 200,
  "success": true,
  "data": [
    {
      "sku": "L020003",
      "product_name": "Polly Cotton Square Black",
      "qty": 145,
      "available_qty": 130,
      "reserved_qty": 15,
      "location": "A-01-01",
      "warehouse_code": "WHBANDUNG",
      "uom": "PCS",
      "batch_no": null,
      "expiry_date": null,
      "last_updated": "2026-08-14T10:30:00Z"
    },
    {
      "sku": "L020003",
      "product_name": "Polly Cotton Square Black",
      "qty": 80,
      "available_qty": 80,
      "reserved_qty": 0,
      "location": "A-01-02",
      "warehouse_code": "WHBANDUNG",
      "uom": "PCS",
      "batch_no": null,
      "expiry_date": null,
      "last_updated": "2026-08-14T09:15:00Z"
    },
    {
      "sku": "L020076",
      "product_name": "Polly Cotton Square Denim",
      "qty": 62,
      "available_qty": 50,
      "reserved_qty": 12,
      "location": "A-02-01",
      "warehouse_code": "WHBANDUNG",
      "uom": "PCS",
      "batch_no": null,
      "expiry_date": null,
      "last_updated": "2026-08-14T08:45:00Z"
    },
    {
      "sku": "Y107021",
      "product_name": "Lesti Instan Bandana Oatmeal",
      "qty": 35,
      "available_qty": 35,
      "reserved_qty": 0,
      "location": "B-03-02",
      "warehouse_code": "WHBANDUNG",
      "uom": "PCS",
      "batch_no": "BATCH-AUG-001",
      "expiry_date": null,
      "last_updated": "2026-08-13T14:20:00Z"
    },
    {
      "sku": "L119013",
      "product_name": "Rayya Lasercut New Series Rosewood",
      "qty": 28,
      "available_qty": 22,
      "reserved_qty": 6,
      "location": "C-01-03",
      "warehouse_code": "WHJAKARTA",
      "uom": "PCS",
      "batch_no": null,
      "expiry_date": null,
      "last_updated": "2026-08-14T11:00:00Z"
    }
  ],
  "pagination": {
    "current_page": 1,
    "total_pages": 5,
    "total_records": 234,
    "limit": 50,
    "offset": 0
  }
}
Response Fields
FieldTypeDeskripsi
skustringSKU produk
product_namestringNama produk
qtyintegerTotal stok di lokasi ini
available_qtyintegerStok yang tersedia (belum di-reserve)
reserved_qtyintegerStok yang sudah di-reserve untuk order
locationstringLokasi penyimpanan (racking code)
warehouse_codestringKode gudang
uomstringUnit of measure
batch_nostring|nullNomor batch (jika ada)
expiry_datestring|nullTanggal kadaluarsa (jika ada)
last_updateddatetimeWaktu terakhir stok diupdate
Catatan:
  • qty = available_qty + reserved_qty
  • Satu SKU bisa muncul di beberapa location (multiple rows)
  • Gunakan available_qty untuk cek stok yang bisa dijual
  • reserved_qty = stok yang sudah dialokasikan ke order tapi belum di-pick
  • Max limit adalah 500. Request lebih dari 500 akan di-cap ke 500

LOZY API Gateway Documentation v1.0

Webhook Docs