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.
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
| Production | Need Confirm |
| Staging | https://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 Status | Code | Deskripsi |
| 400 | VALIDATION_ERROR | Request body invalid |
| 401 | UNAUTHORIZED | API key invalid/missing |
| 404 | NOT_FOUND | Resource tidak ditemukan |
| 409 | DUPLICATE | Data sudah ada (conflict) |
| 422 | UNPROCESSABLE | Data valid tapi tidak bisa diproses |
| 429 | RATE_LIMITED | Too many requests |
| 500 | INTERNAL_ERROR | Server 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
| Field | Type | Required | Deskripsi |
order_id | string | Yes | ID unik order dari sistem kamu |
marketplace | string | Yes | shopee, tiktok, lazada, zalora, tokopedia, manual |
marketplace_order_id | string | No | Order ID dari marketplace |
status | string | Yes | new, processing, packed, shipped, delivered, cancelled |
customer | object | Yes | Data customer (lihat di bawah) |
items | array | Yes | Item order (min 1) |
shipping | object | No | Info pengiriman |
payment | object | No | Info pembayaran |
notes | string | No | Catatan order |
warehouse_code | string | No | Kode gudang tujuan |
customer object
| Field | Type | Required | Deskripsi |
name | string | Yes | Nama penerima |
phone | string | Yes | No. telepon |
email | string | No | Email |
address | object | Yes | Alamat pengiriman |
customer.address object
| Field | Type | Required |
street | string | Yes |
district | string | No |
city | string | Yes |
province | string | Yes |
postal_code | string | Yes |
country | string | No |
items[] object
| Field | Type | Required | Deskripsi |
sku | string | Yes | SKU produk |
name | string | Yes | Nama produk |
qty | integer | Yes | Jumlah |
price | number | Yes | Harga per item |
total | number | No | Total (qty × price) |
weight_gram | number | No | Berat per item (gram) |
variant | string | No | Varian (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 Param | Type | Deskripsi |
status | string | Filter by status |
marketplace | string | Filter by marketplace |
date_from | string | From date (ISO format) |
date_to | string | To date (ISO format) |
page | integer | Halaman (default: 1) |
limit | integer | Per 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
| Field | Type | Required | Deskripsi |
asn_number | string | Yes | Nomor ASN unik dari sistem kamu |
reference_number | string | No | Nomor PO/referensi |
warehouse_code | string | Yes | Kode gudang tujuan |
supplier | object | Yes | Info supplier |
expected_arrival | string | Yes | Tanggal perkiraan tiba (ISO date: 2024-01-15) |
items | array | Yes | Item yang dikirim (min 1) |
shipping | object | No | Info pengiriman |
notes | string | No | Catatan |
supplier object
| Field | Type | Required |
code | string | Yes |
name | string | Yes |
contact | string | No |
phone | string | No |
items[] object
| Field | Type | Required | Deskripsi |
sku | string | Yes | SKU produk |
name | string | Yes | Nama produk |
qty_expected | integer | Yes | Jumlah yang diharapkan |
unit | string | No | Satuan (default: pcs) |
batch_number | string | No | Nomor batch |
expiry_date | string | No | Tanggal kadaluarsa |
cost_price | number | No | Harga beli per item |
shipping object (opsional)
| Field | Type | Deskripsi |
courier | string | Nama kurir/ekspedisi |
tracking_number | string | No. resi |
shipped_at | string | Waktu 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
| Status | Deskripsi |
pending | ASN dibuat, belum dikirim |
in_transit | Barang dalam perjalanan |
arrived | Barang tiba di gudang, belum di-check |
receiving | Sedang proses penerimaan/QC |
received | Semua item diterima |
partially_received | Sebagian item diterima (ada yang kurang/rusak) |
closed | ASN ditutup/final |
GET /v1/asn
List ASN dengan filter.
| Query Param | Type | Deskripsi |
status | string | Filter by status |
warehouse_code | string | Filter by warehouse |
supplier_code | string | Filter by supplier |
date_from | string | Expected arrival from |
date_to | string | Expected arrival to |
page | integer | Halaman (default: 1) |
limit | integer | Per 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
| Field | Type | Required | Deskripsi |
code | string | Yes | Kode unik vendor (max 100 char) |
name | string | Yes | Nama vendor/supplier |
description | string | No | Deskripsi 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
| Field | Type | Required | Deskripsi |
sku | string | Yes | SKU unik produk (max 50 char) |
name | string | Yes | Nama produk |
parent | string | No | Parent SKU (untuk variant grouping) |
description | string | No | Deskripsi produk |
category_id | string | No | ID kategori produk |
is_sn | boolean | No | Apakah produk ini punya serial number tracking (default: false) |
is_expired | boolean | No | Apakah produk ini punya expiry date tracking (default: false) |
uom | string | No | Unit of measure (default: PCS). Contoh: PCS, BOX, KG, SET |
temperature_zone | string | No | Zona 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
| Param | Type | Required | Deskripsi |
date_from | string | No | Filter completion date from (ISO: 2026-07-21) |
date_to | string | No | Filter completion date to |
order_source | string | No | SHOPEE, TIKTOK, LAZADA, ZALORA |
payment_status | string | No | PAID, PENDING, REFUNDED |
page | integer | No | Halaman (default: 1) |
limit | integer | No | Per 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
| Field | Type | Deskripsi |
finance_transaction_id | string | ID unik transaksi finance |
order_id | string | Order ID internal LOZY |
external_order_no | string | Order ID dari marketplace |
order_source | string | Marketplace asal |
order_date | datetime | Tanggal order dibuat |
completion_date | datetime | Tanggal order completed/delivered |
currency | string | Mata uang |
exchange_rate | number | Kurs (1 untuk IDR) |
customer_info
| Field | Type | Deskripsi |
customer_id | string | ID customer |
customer_name | string | Nama customer |
billing_city | string | Kota billing |
summary_amounts
| Field | Type | Deskripsi |
subtotal | number | Total harga item sebelum diskon |
discount_amount | number | Total diskon |
tax_amount | number | Pajak |
shipping_cost | number | Ongkos kirim |
marketplace_admin_fee | number | Fee admin marketplace |
grand_total | number | Total akhir yang diterima |
items[]
| Field | Type | Deskripsi |
item_id | string | ID item |
sku | string | SKU produk |
item_name | string | Nama produk |
qty | integer | Jumlah |
unit_price | number | Harga per unit |
line_discount | number | Diskon per baris |
line_total | number | Total baris setelah diskon |
cogs_per_unit | number | HPP per unit (Cost of Goods Sold) |
pagination
| Field | Type | Deskripsi |
current_page | integer | Halaman saat ini |
total_pages | integer | Total halaman |
total_records | integer | Total record |
limit | integer | Per halaman |
offset | integer | Offset |
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
| Param | Type | Required | Deskripsi |
sku | string | No | Filter by SKU (exact match atau partial: SKU-001) |
location | string | No | Filter by lokasi/racking (contoh: A-01-01) |
warehouse_code | string | No | Filter by gudang |
page | integer | No | Halaman (default: 1) |
limit | integer | No | Per 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
| Field | Type | Deskripsi |
sku | string | SKU produk |
product_name | string | Nama produk |
qty | integer | Total stok di lokasi ini |
available_qty | integer | Stok yang tersedia (belum di-reserve) |
reserved_qty | integer | Stok yang sudah di-reserve untuk order |
location | string | Lokasi penyimpanan (racking code) |
warehouse_code | string | Kode gudang |
uom | string | Unit of measure |
batch_no | string|null | Nomor batch (jika ada) |
expiry_date | string|null | Tanggal kadaluarsa (jika ada) |
last_updated | datetime | Waktu 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