Record a posted unload (your counted transfer journal back from a van)
using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Put, RequestUri = new Uri("https://api.slflo.com/api/integration/v1/stock/unloads/TJ-JNL-0815"), Headers = { { "Idempotency-Key", "example" }, { "Authorization", "Bearer <token>" }, }, Content = new StringContent("{ \"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\" }") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } }};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://api.slflo.com/api/integration/v1/stock/unloads/TJ-JNL-0815")) .header("Idempotency-Key", "example") .header("Authorization", "Bearer <token>") .header("Content-Type", "application/json") .method("PUT", HttpRequest.BodyPublishers.ofString("{ \"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\" }")) .build();HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());System.out.println(response.body());const url = 'https://api.slflo.com/api/integration/v1/stock/unloads/TJ-JNL-0815';const options = { method: 'PUT', headers: { 'Idempotency-Key': 'example', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"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"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Your key for the unload — the posted transfer journal’s id in your ERP.
Example
TJ-JNL-0815Header Parameters
Section titled “Header Parameters”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.
Request Bodyrequired
Section titled “Request Bodyrequired”object
object
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"}Responses
Section titled “Responses”Record a posted unload (your counted transfer journal back from a van)
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
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 }}default
Section titled “default”An error: the code says what, retryable whether to try again.
object
object
Stable code, e.g. SCOPE_MISSING, UNKNOWN_REFERENCE.
Field-level problems: {field, code}.
object
What happened and how to fix it.
Quote it to support; it finds the server log.
Whether the same call may succeed later.
Example
{ "error": { "code": "SCOPE_MISSING", "details": [], "message": "This client does not hold the invoices:read scope.", "request_id": "req_01J9X4Q7T2M8P3NRT6V5WZ", "retryable": false }}
