Synchronizing transactions via Bitlog API
For every stock transaction that is performed in Bitlog WMS a synchronization (sync) record is created at the background. These sync-records can be retrieved via Bitlog API. Following is the list of most common record types that are created:

  • In Incoming transaction, such as receive of a purchase order or customer return

  • Out Outgoing transaction, such as shipment of a sales order

  • Move Movement of stock between warehouses

  • Take Positive or negative stock takes

These transactions can be retrieved and updated using transaction/sync endpoints:


The most common way to handle sync transactions is as follows:

  1. Call GET sync to retrieve the next available transaction

  2. Process transaction

  3. Report the result of processing by calling PUT sync

  4. Repeat the sequence until GET sync returns null, meaning that the sync queue is empty


GET sync


This endpoint will give you the next available not blocked transaction according to the transaction time. Transaction can be blocked by an earlier transaction for the same stock item.

For example, let's consider the following two transactions:

Id

Time

Type

Stock item

10

10:00

In

APPLE

11

11:00

Out

APPLE

If you get a problem processing transaction Id 10 and you report it as failed, the transaction Id 11 will get blocked because there is a big chance that it will fail as well (we cannot ship something that is not on stock).
The blocking process is performed automatically by the API by examining blocked transactions when looking for the next one that is waiting. This also means that the more transactions get blocked, the bigger a chance that you get a chain reaction of blocking.
Unblocking of transactions can be done only in WMS Manager as of right now. There you can either try this transaction again or mark it as resolved.
GET sync/Id Use this endpoint to retrieve a transaction by its Id.
PUT sync/id


Use this endpoint to report the result of processing a transaction at the backend. The most common is to send 1 as a result of a successful operation and a negative value and an error message in a case of a faulty one. You may include a message even on successful operation, such as a reference number that can be used to trace transactions at the backend.

Examples for transactions

IN

{
  "order": "165",
  "time": "2021-04-01T12:37:10.25",
  "id": 122,
  "type": "In",
  "warehouse": "ML",
  "remark": null,
  "lines": [
    {
      "line": 2,
      "item": "1002",
      "quantity": 5,
      "remark": null,
      "warehouse": "ML"
    }
  ]
}

OUT

{
  "order": "000141842",
  "time": "2021-03-26T13:09:23.563",
  "id": 123,
  "type": "Out",
  "warehouse": "ML",
  "remark": null,
  "lines": [
    {
      "line": 10,
      "item": "1002",
      "quantity": 1,
      "remark": null,
      "warehouse": "ML"
    }
  ]
}

MOVE

{
  "order": null,
  "time": "2020-11-06T12:10:41.663",
  "id": 124,
  "type": "Move",
  "warehouse": "ML",
  "remark": null,
  "lines": [
    {
      "line": 1,
      "item": “1001”,
      "quantity": 10,
      "remark": null,
      "warehouse": "SL"
    }
  ]
}

TAKE

{
  "order": null,
  "time": "2021-03-26T13:08:28.787",
  "id": 125,
  "type": "Take",
  "warehouse": "ML",
  "remark": null,
  "lines": [
    {
      "line": 1,
      "item": "1001",
      "quantity": 100,
      "remark": null,
      "warehouse": "ML"
    }
  ]
}