Skip to content

Record a posted unload (your counted transfer journal back from a van)

PUT
/api/integration/v1/stock/unloads/{ref}
curl --request PUT \
--url https://api.slflo.com/api/integration/v1/stock/unloads/TJ-JNL-0815 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: example' \
--data '{ "counted_at": "2026-10-09T15:10:00Z", "held_back": false, "lines": [ { "lot": "L2410", "product": "ITEM-1001", "quantity": "22", "unit": null } ], "number": "TJ-000815", "source_version": "5637145390", "to": "WH-MAIN", "van": "VAN-03" }'

Ref is your posted journal’s id. One journal empties one place: the van, or with held_back: true the van’s held-back place (to is then a warehouse’s held-back place, or the warehouse). lines is what the storekeeper counted, 0 to 500, an empty list for nothing back. Per product and lot, what the place held against what was counted: the counted part moves to to; a shortage is written off the van and recorded as the rep’s (shortages, valued at the list price); an overage is counted in, then moved. The place is empty after. result: created (a new UL- number), unchanged (the same journal again), stale (an older source_version). The same ref with other content is 409 UNLOAD_ALREADY_RECORDED: post a correction as a new journal. While a load waits on the van (good stock only) 409 LOAD_STILL_WAITING, and while the rep’s day is under way 409 VAN_DAY_NOT_ENDED: both retryable, send it again later. Needs stock:write and Stock is managed in your ERP. Use a new Idempotency-Key for each journal; the same key only for a retry of that send.

ref
required
string

Your key for the unload — the posted transfer journal’s id in your ERP.

Example

TJ-JNL-0815
Idempotency-Key
required
string

Your key for this write, at most 100 characters (an order id or journal id works well). Required on every write; kept 7 days. Same key and body: the first answer again. Same key, other body: 422 IDEMPOTENCY_KEY_REUSED.

Media typeapplication/json
object
counted_at
string
held_back
boolean
lines
Array<object>
object
lot
string
product
string
quantity
string
unit
string
number
string
source_version
string
to
string
van
string

Example

{
"counted_at": "2026-10-09T15:10:00Z",
"held_back": false,
"lines": [
{
"lot": "L2410",
"product": "ITEM-1001",
"quantity": "22",
"unit": null
}
],
"number": "TJ-000815",
"source_version": "5637145390",
"to": "WH-MAIN",
"van": "VAN-03"
}

Record a posted unload (your counted transfer journal back from a van)

Media typeapplication/json
object
data
required
object
business_day
required
string
counted_at
required
string
entity
required
string
external_number
string
external_ref
required
string
from
required
object
code
required
string
id
required
string
name
required
object
key
additional properties
string
held_back
required
boolean
id
required
string
lines
required
Array<object>
object
counted
required
string
held
required
string
lot
string
overage
required
string
product
required
object
code
string
external_ref
string
id
required
string
shortage
required
string
unit
required
object
code
string
external_ref
string
id
required
string
number
required
string
rep
object
code
string
id
required
string
name
required
object
key
additional properties
string
result
string
shortages
required
Array<object>
object
currency
string
id
required
string
lot
string
product
required
object
code
string
external_ref
string
id
required
string
quantity
required
string
unit_price
string
value
string
to
required
object
code
required
string
id
required
string
name
required
object
key
additional properties
string
van
required
object
code
required
string
id
required
string
name
required
object
key
additional properties
string
version
required
integer format: int64

Example

{
"data": {
"business_day": "2026-10-09",
"counted_at": "2026-10-09T15:10:00Z",
"entity": "van_unload",
"external_number": "TJ-000815",
"external_ref": "TJ-JNL-0815",
"from": {
"code": "VAN-03",
"id": "loc_van03",
"name": {
"ar": "سيارة 3",
"en": "Van 3"
}
},
"held_back": false,
"id": "op_01J9U",
"lines": [
{
"counted": "22",
"held": "24",
"lot": "L2410",
"overage": "0",
"product": {
"code": "SKU-COLA",
"external_ref": "ITEM-1001",
"id": "P0000001"
},
"shortage": "2",
"unit": {
"code": "PCS",
"external_ref": "pcs",
"id": "PCS"
}
}
],
"number": "UL-000044",
"rep": {
"code": "R012",
"id": "rep_12",
"name": {
"ar": "كريم عادل",
"en": "Karim Adel"
}
},
"result": "created",
"shortages": [
{
"currency": "EGP",
"id": "vs_01J9V",
"lot": "L2410",
"product": {
"code": "SKU-COLA",
"external_ref": "ITEM-1001",
"id": "P0000001"
},
"quantity": "2",
"unit_price": "100.00",
"value": "200.00"
}
],
"to": {
"code": "WH-MAIN",
"id": "loc_wh",
"name": {
"ar": "المخزن الرئيسي",
"en": "Main warehouse"
}
},
"van": {
"code": "VAN-03",
"id": "loc_van03",
"name": {
"ar": "سيارة 3",
"en": "Van 3"
}
},
"version": 9420
}
}

An error: the code says what, retryable whether to try again.

Media typeapplication/json
object
error
required
object
code
required

Stable code, e.g. SCOPE_MISSING, UNKNOWN_REFERENCE.

string
details
required

Field-level problems: {field, code}.

Array<object>
object
key
additional properties
string
message
required

What happened and how to fix it.

string
request_id
required

Quote it to support; it finds the server log.

string
retryable
required

Whether the same call may succeed later.

boolean

Example

{
"error": {
"code": "SCOPE_MISSING",
"details": [],
"message": "This client does not hold the invoices:read scope.",
"request_id": "req_01J9X4Q7T2M8P3NRT6V5WZ",
"retryable": false
}
}