Send a load (your transfer journal) to 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/loads/TJ-JNL-0812"), Headers = { { "Idempotency-Key", "example" }, { "Authorization", "Bearer <token>" }, }, Content = new StringContent("{ \"from\": \"WH-MAIN\", \"lines\": [ { \"expires_on\": \"2027-03-31\", \"lot\": \"L2410\", \"product\": \"ITEM-1001\", \"quantity\": \"10\", \"unit\": \"cs\" } ], \"note\": \"Two cases are for Al Amal Market.\", \"number\": \"TJ-000812\", \"source_version\": \"5637145326\", \"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/loads/TJ-JNL-0812")) .header("Idempotency-Key", "example") .header("Authorization", "Bearer <token>") .header("Content-Type", "application/json") .method("PUT", HttpRequest.BodyPublishers.ofString("{ \"from\": \"WH-MAIN\", \"lines\": [ { \"expires_on\": \"2027-03-31\", \"lot\": \"L2410\", \"product\": \"ITEM-1001\", \"quantity\": \"10\", \"unit\": \"cs\" } ], \"note\": \"Two cases are for Al Amal Market.\", \"number\": \"TJ-000812\", \"source_version\": \"5637145326\", \"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/loads/TJ-JNL-0812';const options = { method: 'PUT', headers: { 'Idempotency-Key': 'example', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"from":"WH-MAIN","lines":[{"expires_on":"2027-03-31","lot":"L2410","product":"ITEM-1001","quantity":"10","unit":"cs"}],"note":"Two cases are for Al Amal Market.","number":"TJ-000812","source_version":"5637145326","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/loads/TJ-JNL-0812 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: example' \ --data '{ "from": "WH-MAIN", "lines": [ { "expires_on": "2027-03-31", "lot": "L2410", "product": "ITEM-1001", "quantity": "10", "unit": "cs" } ], "note": "Two cases are for Al Amal Market.", "number": "TJ-000812", "source_version": "5637145326", "van": "VAN-03" }'Ref is your journal id. van and from are SLFLO location codes: from is a warehouse (kind LOAD) or the giving van (kind VAN_TRANSFER, van to van); a held-back place is 422 NOT_A_WAREHOUSE. The goods go onto the van at once and wait for the rep to accept or refuse; the source warehouse is not checked (your ERP vouches for it), a giving van is: it must hold every line (422 INSUFFICIENT_VAN_STOCK names each short one), and a refusal, replace or cancel puts the goods back on it. Only the receiving van’s rep answers. result: created (a new LD- number), replaced (other goods while it waits: a new LD-, replaced_id the old one), updated (only number or note), unchanged, stale (an older source_version). After a refusal the same ref is a re-send: a new load, resent_from on the feed. After the rep accepted, other goods are 409 LOAD_ALREADY_CHECKED. Needs stock:write and Stock is managed in your ERP (else 409 ERP_STOCK_NOT_ENABLED). Use a new Idempotency-Key for each send; 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 load — the transfer journal’s id in your ERP.
Example
TJ-JNL-0812Header 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
{ "from": "WH-MAIN", "lines": [ { "expires_on": "2027-03-31", "lot": "L2410", "product": "ITEM-1001", "quantity": "10", "unit": "cs" } ], "note": "Two cases are for Al Amal Market.", "number": "TJ-000812", "source_version": "5637145326", "van": "VAN-03"}Responses
Section titled “Responses”Send a load (your transfer journal) to a van
object
object
Example
{ "data": { "entity": "van_load", "external_ref": "TJ-JNL-0812", "id": "op_01J9L", "kind": "LOAD", "number": "LD-000231", "replaced_id": null, "result": "created", "state": "WAITING" }}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 }}
