Developer docs

Operations API (v1)

The v1 API lets your own system do what staff do in the app: open a return case (BaseLinker return, DPD pickup, monday.com item, all in one call), send a part or a missing product to a customer, read stock and the changes between stock readings, and bulk-assign suppliers to products.

Access

FactValue
Base URLhttps://salehero.ro/api/v1
KeyAn organization API key with scope v1 (Settings, API keys)
Rate limit120 requests per minute per key
Content typeapplication/json

Authentication, errors and rate limits are described on the overview page. Everything here is scoped to the key's organization; there is no cross-organization form of any call.

Stock

GET/api/v1/stocks

Current stock per warehouse and SKU. By default it reads live from your SmartBill account; with cached=true it returns the latest stored reading instead.

Parameters

warehouseNamestring
Only this warehouse, by its exact name.
cachedboolean
Pass cached=true to read the stored snapshot. Leave the parameter out for the live read; any value present counts as true.

Request

curl -s "https://salehero.ro/api/v1/stocks?cached=true&warehouseName=Main" \
  -H "Authorization: Bearer $SALEHERO_API_KEY"

Response

{
  "takenAt": "2026-11-10T08:00:00.000Z",
  "stocks": [
    { "warehouse": "Main", "sku": "SKU-001", "productName": "Example product", "unit": "buc", "quantity": 33 }
  ]
}
  • The live read needs a SmartBill connection; without one the answer is 400. A SmartBill failure is relayed as 401 (credentials) or 502.
  • With cached=true and no stored reading yet, takenAt is null and stocks is empty.
GET/api/v1/snapshots

The history of stock polls, newest first, with how many readings and changes each produced.

Parameters

takeinteger 1–200
How many snapshots to return.

Request

curl -s "https://salehero.ro/api/v1/snapshots?take=2" \
  -H "Authorization: Bearer $SALEHERO_API_KEY"

Response

{
  "snapshots": [
    {
      "id": "cm…",
      "takenAt": "2026-11-10T08:00:00.000Z",
      "source": "SCHEDULED",
      "status": "OK",
      "readings": 1840,
      "changes": 12,
      "durationMs": 5210
    }
  ]
}
  • source is SCHEDULED or MANUAL; status is OK, PARTIAL or ERROR.
GET/api/v1/diffs

Stock differences: what changed between two readings of a SKU in a warehouse.

Parameters

warehouseIdstring
Only this warehouse.
skustring
Only this SKU.
changeTypeNEW | REMOVED | INCREASED | DECREASED
Kind of change.
from, todate
Detected between these dates (ISO 8601).
sort, dirstring, asc | desc
Sort field and direction.
takeinteger 1–500
Page size.
skipinteger ≥ 0
Rows to skip, for paging.

Request

curl -s "https://salehero.ro/api/v1/diffs?changeType=DECREASED&take=1" \
  -H "Authorization: Bearer $SALEHERO_API_KEY"

Response

{
  "total": 57,
  "diffs": [
    {
      "id": "cm…",
      "warehouse": "Main",
      "warehouseId": "cm…",
      "sku": "SKU-001",
      "productName": "Example product",
      "previousQty": 36,
      "currentQty": 33,
      "delta": -3,
      "changeType": "DECREASED",
      "detectedAt": "2026-11-10T08:00:00.000Z",
      "snapshotId": "cm…"
    }
  ]
}
  • total counts every match, not just the page.

Bulk-assign suppliers

POST/api/v1/import/suppliers

Link products to suppliers by SKU. Suppliers are created the first time their name appears (names match regardless of case); products are only updated, never created.

Parameters

assignmentsarray 1–1000 · required
Objects of { sku, supplier }. Both are non-empty strings (SKU up to 120 characters, supplier up to 200). The last assignment for a SKU wins.
overwriteboolean
Replace a supplier a product already has. Without it, existing links are kept.
dryRunboolean
Compute the report and change nothing.

Request

curl -s -X POST https://salehero.ro/api/v1/import/suppliers \
  -H "Authorization: Bearer $SALEHERO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "assignments": [
      { "sku": "SKU-001", "supplier": "Example Supplier Ltd" },
      { "sku": "SKU-002", "supplier": "Example Supplier Ltd" }
    ],
    "dryRun": true
  }'

Response

{
  "received": 2,
  "suppliersMatched": 0,
  "suppliersCreated": 1,
  "linked": 2,
  "alreadyLinked": 0,
  "keptExisting": 0,
  "unknownSkus": 0,
  "unknownSkuSamples": []
}
  • The body is capped at 2 MB. The call is idempotent: repeating it changes nothing the second time. Start with dryRun to see the report first.
  • unknownSkuSamples lists up to 20 SKUs SaleHero does not have.

Returns

POST /api/v1/returns does what the New return dialog on an order page does, in one call: it records the case, creates the return in BaseLinker Returns, issues a DPD pickup AWB from the customer's address to one of your delivery points, and files the refund or repair items on your monday.com board. The AWB is a return label: the customer is the sender and the recipient pays. Each of those steps is optional.

A 201 only promises that the case exists. Read delivery.status, awb.status and monday.status in the answer: any of them can be PENDING or FAILED, on purpose, so that a courier outage never loses the case. Each case is also posted to the organization's default Slack channel so a person can check what the integration filed.

A return is for goods coming back. When nothing comes back and you only send something to the customer (a spare part, a missing product), use POST /api/v1/cases with kind SEND: a return whose every line's solution starts with "Trimitere" is refused with use_send_case. When the old unit comes back and a new one goes out, make both calls.

GET/api/v1/returns/options

The DPD pickup points and monday.com labels a return may use right now. Read these instead of hard-coding them: they are per organization.

Request

curl -s https://salehero.ro/api/v1/returns/options \
  -H "Authorization: Bearer $SALEHERO_API_KEY"

Response

{
  "dpd": {
    "configured": true,
    "mockMode": false,
    "pickupPoints": [ { "clientId": "1234567", "label": "Warehouse" } ]
  },
  "monday": {
    "configured": true,
    "mockMode": false,
    "boardName": "Returns",
    "labels": {
      "caseType": ["Return", "Warranty"],
      "reason": ["Defective", "Not as described"],
      "solution": ["Refund", "Replacement", "Repair"]
    },
    "labelsError": null
  }
}
  • The first pickup point is the default. Send caseType, reason and solution spelled exactly as the board's labels, or monday drops the value silently (SaleHero rejects an unknown label with unknown_label before writing anything). mockMode: true means a sandbox connection: nothing reaches the courier.
POST/api/v1/returns

Open a return case.

Parameters

orderNumberstring
The order's number in its source. Send this or orderId.
orderIdstring
SaleHero's own order id; wins when both are sent. If several orders carry one number you get 409 ambiguous_order: send orderId.
reasonstring 1–2000 · required
Free text: why the customer is returning. It goes into the BaseLinker return, the DPD note and the monday update.
linesarray 1–100 · required
What comes back: { sku, quantity, caseType?, reason?, solution? }. The SKU must be on that order and the quantity not higher than the order holds. Prices and names are read from the order, never accepted from you.
parcelsinteger 1–50
Parcels handed over. Default 1.
totalWeightnumber, kg
Total weight for the pickup. Default 1 kg per parcel.
generateAwbboolean
Default true. false opens the case with no courier booking.
createMondayItemsboolean
Default true. false leaves the board untouched.
dpdClientIdstring
Where the parcel goes back to: a clientId from /returns/options. Default: the first point.
pickupAddressobject
Collect somewhere other than the order's delivery address: { name?, phone?, address, city, state?, postcode? }. DPD needs a name, phone, street, city and a county or postcode.

Request

curl -s -X POST https://salehero.ro/api/v1/returns \
  -H "Authorization: Bearer $SALEHERO_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "orderNumber": "ORDER-1001",
    "reason": "The motor stops under load",
    "lines": [
      { "sku": "SKU-001", "quantity": 1, "caseType": "Warranty", "reason": "Defective", "solution": "Refund" }
    ],
    "parcels": 1,
    "totalWeight": 3.5
  }'

Response

{
  "replayed": false,
  "warnings": [],
  "return": {
    "id": "cm…",
    "identifier": "RET-000142",
    "origin": "STAFF",
    "orderNumber": "ORDER-1001",
    "customerName": "Example Customer",
    "description": "The motor stops under load",
    "delivery": { "status": "SENT", "blReturnId": "90123", "attempts": 1, "lastError": null },
    "awb": { "status": "DONE", "number": "80000000001", "pickupDate": "2026-11-12", "error": null },
    "monday": { "status": "DONE", "items": [ { "kind": "REFUND", "itemId": "…", "url": "https://…" } ], "error": null },
    "lines": [ { "sku": "SKU-001", "quantity": 1, "caseType": "Warranty", "reason": "Defective", "solution": "Refund", "refund": true } ],
    "createdBy": "API key: ERP integration"
  }
}
  • The answer is the whole case, trimmed here. A solution that reads as money back (it contains restituire, refund, ramburs, returnare bani or bani inapoi, any case) puts the line on the REFUND monday item; every other line goes on the REPAIR item.
  • warnings never fail the call. Codes: awb_not_requested, case_type_missing, reason_missing, solution_missing, awb_failed, monday_failed.
  • The full call takes 3 to 10 seconds (BaseLinker, DPD and monday in sequence); allow a client timeout of about 120 seconds.

Idempotency. This call books a courier, so a blind retry is expensive and two identical POSTs make two cases. Send an Idempotency-Key header (any string up to 200 characters, one per attempt; a UUID is the usual choice) and SaleHero remembers it per organization for 24 hours:

SituationAnswer
First use of the key201, replayed: false
Repeat after it finished200 with the same case, replayed: true; nothing is created again
Repeat while the first is running409 idempotency_in_progress
Repeat after a 4xx (nothing was created)The key is free again; the work runs
Repeat after a 5xx (outcome unknown)409 idempotency_in_progress: look the case up with GET, do not post again
GET/api/v1/returns

List return cases, newest first, whatever opened them.

Parameters

originCUSTOMER | STAFF | BASELINKER
Who opened the case.
qstring
Matches the RET identifier (RET-000142 or 142), order number, customer name or email, AWB number or BaseLinker return id.
takeinteger 1–500
Page size.

Request

curl -s "https://salehero.ro/api/v1/returns?q=ORDER-1001" \
  -H "Authorization: Bearer $SALEHERO_API_KEY"

Response

{ "returns": [ { "identifier": "RET-000142", "…": "the case object shown above" } ], "total": 1 }
  • total counts every case matching the filter, not the page.
GET/api/v1/returns/{id}

One case, by its id or its identifier (RET-000142, or 142). Poll this one: delivery.status and the BaseLinker fields move after the POST returns, as failed deliveries are retried. Every few minutes is plenty.

Request

curl -s https://salehero.ro/api/v1/returns/RET-000142 \
  -H "Authorization: Bearer $SALEHERO_API_KEY"

Response

{ "return": { "identifier": "RET-000142", "delivery": { "status": "SENT" }, "awb": { "status": "DONE" }, "…": "…" } }
StatuscodeWhen
400order_requiredNeither orderId nor orderNumber was sent.
400line_not_in_orderA line's SKU is not on that order.
400quantity_exceedsA quantity is higher than the order holds.
400dpd_not_configuredNo DPD account is connected. Send generateAwb: false to skip the pickup.
400pickup_address_incompleteName, phone, street, city and county or postcode are not all present.
400unknown_pickup_pointdpdClientId is not one of the connection's points.
400monday_not_configuredNo board is connected. Send createMondayItems: false.
400unknown_labelA caseType, reason or solution is not a label on the board.
400use_send_caseEvery line's solution sends goods out ("Trimitere …"). Use POST /api/v1/cases.
404not_foundNo such order (POST) or no such case (GET).
409ambiguous_orderSeveral orders carry that number. Send orderId.
409idempotency_in_progressThat key is in flight, or its request ended with an unknown outcome.

Every 400, 404 and 409 above is raised before the case is written, so nothing exists anywhere when you get one. After a 500 or a timeout the outcome is unknown: look the case up with GET /api/v1/returns?q=<order number> before doing anything else.

Sends and missing products

POST /api/v1/cases does what the case dialog on an order page does. kind SEND is goods going out to the customer: SaleHero issues a DPD AWB from one of your points to the customer (you pay), optionally creates a zero-priced order in BaseLinker so the warehouse packs it, and files the case on your monday.com cases board. kind MISSING files only the board item.

GET/api/v1/cases/options

Your DPD points and the cases board's labels. They are not the returns board's labels.

Request

curl -s https://salehero.ro/api/v1/cases/options \
  -H "Authorization: Bearer $SALEHERO_API_KEY"

Response

{
  "dpd": { "configured": true, "pickupPoints": [ { "clientId": "1234567", "label": "Warehouse" } ] },
  "monday": { "configured": true, "labels": { "caseType": ["…"], "reason": ["…"], "solution": ["Trimitere Piese"] } },
  "baseLinker": { "configured": true }
}
POST/api/v1/cases

Open a send or missing-product case.

Parameters

orderNumberstring
The order's number in its source. Send this or orderId.
kindSEND | MISSING · required
SEND ships goods to the customer; MISSING only files the board item.
lines{ sku, quantity }[] · required
1 to 100 lines. Each SKU must be on the order, each quantity no more than it holds.
caseType, reason, solutionstring
Labels of the cases board, from /api/v1/cases/options.
generateAwbboolean
SEND only, default true: the DPD AWB to the customer.
recipientAddressobject
SEND only. Defaults to the order's delivery address.

Request

curl -s -X POST https://salehero.ro/api/v1/cases \
  -H "Authorization: Bearer $SALEHERO_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: send-77749-1" \
  -d '{ "orderNumber": "77749", "kind": "SEND", "solution": "Trimitere Piese",
        "lines": [ { "sku": "LAMP-01-SHADE", "quantity": 1 } ],
        "description": "Glass shade arrived broken" }'

Response

{
  "replayed": false,
  "case": {
    "identifier": "CAZ-000031",
    "kind": "SEND",
    "awb": { "status": "DONE", "number": "80912345678" },
    "sendOrder": { "status": "SKIPPED" },
    "monday": { "status": "DONE" },
    "…": "…"
  }
}
  • As with returns, a 201 only promises the case exists: read awb.status, sendOrder.status and monday.status. Every case opened through the API is also posted to Slack for a person to check.
GET/api/v1/cases/{id}

One case, by its id or its identifier (CAZ-000031, or 31). GET /api/v1/cases lists them, with kind, q and take.

Request

curl -s https://salehero.ro/api/v1/cases/CAZ-000031 \
  -H "Authorization: Bearer $SALEHERO_API_KEY"

Response

{ "case": { "identifier": "CAZ-000031", "awb": { "status": "DONE" }, "…": "…" } }

Get an API key

Create an account, connect your tools, then create a key in Settings.