Skip to content

Push up to 500 records in one call

POST
/api/integration/v1/batch/{entity}
curl --request POST \
--url https://api.slflo.com/api/integration/v1/batch/products \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: example' \
--data '{ "items": [ { "body": { "base_unit_ref": "pcs", "name": { "en": "Cola 330ml" } }, "ref": "ITEM-1001" }, { "body": { "base_unit_ref": "box", "name": { "en": "Water 1.5l" } }, "ref": "ITEM-1002" } ] }'

Entity is products, units or balances; each item is {ref, body} with the PUT’s body and gets its own result. Counts as one request for the rate limit. Send an Idempotency-Key header; a retry with the same key and body answers the first answer again, with Idempotent-Replayed: true.

entity
required
string

What the batch holds: products, units or balances.

Example

products
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
items
required
Array<object>
object
body
object
ref
required
string

Example

{
"items": [
{
"body": {
"base_unit_ref": "pcs",
"name": {
"en": "Cola 330ml"
}
},
"ref": "ITEM-1001"
},
{
"body": {
"base_unit_ref": "box",
"name": {
"en": "Water 1.5l"
}
},
"ref": "ITEM-1002"
}
]
}

Push up to 500 records in one call

Media typeapplication/json
object
data
required
Array<object>
object
error
object
key
additional properties
object
ok
required
boolean
ref
required
string
result
object
entity
required
string
external_ref
required
string
id
required
string
result
required
string
meta
required
object
key
additional properties
integer format: int32

Example

{
"data": [
{
"error": null,
"ok": true,
"ref": "ITEM-1001",
"result": {
"entity": "product",
"external_ref": "ITEM-1001",
"id": "P0000001",
"result": "unchanged"
}
},
{
"error": {
"code": "UNKNOWN_REFERENCE",
"details": [],
"message": "Unknown unit box: PUT /units/box first."
},
"ok": false,
"ref": "ITEM-1002",
"result": null
}
],
"meta": {
"applied": 1,
"failed": 1
}
}

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