Skip to content

Send a load (your transfer journal) to a van

PUT
/api/integration/v1/stock/loads/{ref}
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.

ref
required
string

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

Example

TJ-JNL-0812
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
from
string
lines
Array<object>
object
expires_on
string
lot
string
product
string
quantity
string
unit
string
note
string
number
string
source_version
string
van
string

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"
}

Send a load (your transfer journal) to a van

Media typeapplication/json
object
data
required
object
entity
required
string
external_ref
required
string
id
required
string
kind
required
string
number
required
string
replaced_id
string
result
required
string
state
required
string

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"
}
}

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
}
}