Inventory Moves


Attributes

Attribute Type Description
Read-only attribute
id Integer Unique identifier in Fakturoid
Required attribute
direction String Move direction
Values: in, out
Required attribute
moved_on Datetime Move date
Required attribute
quantity_change Decimal Item quantity in move
Required attribute
purchase_price Decimal Purchase price per unit (without VAT)
purchase_currency String Purchase currency
Values: Currency code (3 characters). See all supported currencies here.
Default: Inherit from account settings
native_purchase_price Decimal Unit purchase price in account currency
retail_price Decimal Retail price per unit
retail_currency String Retail currency
Values: Currency code (3 characters)
List of supported currencies
Default: Inherit from account settings
native_retail_price Decimal Retail price in account currency
private_note Text Private note
Read-only attribute
inventory_item_id Integer Inventory item ID
Read-only attribute
document Object Details about document and line the move is tied to
Default: null
Read-only attribute
created_at DateTime Date and time of move creation
Read-only attribute
updated_at DateTime Date and time of last move update

Document

Attribute Type Description
Read-only attribute
id Integer Document ID
Read-only attribute
type String Type of document
Values: Estimate, Expense, ExpenseGenerator, Generator, Invoice
Read-only attribute
line_id Integer Document line ID
  • Required attribute
    Required attribute (must always be present).
  • Read-only attribute
    Read-only attribute (cannot be changed).
  • Write-only attribute
    Write-only attribute (will not be returned).
  • Unmarked attributes are optional and can be omitted during request.

Inventory Moves Index

If query parameters since, until, updated_since and updated_until are not valid date time format (ISO 8601) the server will respond with 400 Bad Request.

Request

GET https://app.fakturoid.cz/api/v3/accounts/{slug}/inventory_moves.json

Headers

Name Value
User-Agent YourApp (yourname@example.com)

URL Parameters

Name Description Type Example
slug Account name String applecorp

Query Parameters

Name Description Type Example
since Moves created after this date DateTime 2023-08-25T10:55:14+02:00
until Moves created before this date DateTime 2023-08-25T10:55:14+02:00
updated_since Moves created or updated after this date DateTime 2023-08-25T10:55:14+02:00
updated_until Moves created or uptated before this date DateTime 2023-08-25T10:55:14+02:00
page Page number (40 records per page) Integer 2
inventory_item_id Filter moves by inventory item ID Integer 1

Response

Status 200 OK

Body

[
  {
    "id": 1,
    "direction": "in",
    "moved_on": "2023-08-05",
    "quantity_change": "1000.0",
    "purchase_price": "500.0",
    "purchase_currency": "CZK",
    "native_purchase_price": "500.0",
    "retail_price": null,
    "retail_currency": "CZK",
    "native_retail_price": null,
    "private_note": null,
    "inventory_item_id": 1,
    "document": null,
    "created_at": "2023-08-05T13:26:20.871+02:00",
    "updated_at": "2023-08-05T13:26:20.871+02:00"
  },
  {
    "id": 24,
    "direction": "in",
    "moved_on": "2023-08-07",
    "quantity_change": "624.0",
    "purchase_price": "1978.0",
    "purchase_currency": "CZK",
    "native_purchase_price": "1978.0",
    "retail_price": null,
    "retail_currency": "CZK",
    "native_retail_price": null,
    "private_note": "3 letá záruka za příplatek. Disk je vybaven nejnovějším řadičem, který umožňuje dosahovat rychlosti čtení až 500 MB/s a zápisu 320 MB/s.",
    "inventory_item_id": 46,
    "document": {
      "id": 540,
      "type": "Invoice",
      "line_id": 1298
    },
    "created_at": "2023-09-05T13:26:21.041+02:00",
    "updated_at": "2023-09-05T13:26:21.041+02:00"
  },
  …
]

Inventory Move Detail

Request

GET https://app.fakturoid.cz/api/v3/accounts/{slug}/inventory_items/{inventory_item_id}/inventory_moves/{id}.json

Headers

Name Value
User-Agent YourApp (yourname@example.com)

URL Parameters

Name Description Type Example
slug Account name String applecorp
inventory_item_id Inventory item ID Integer 1
id Move ID Integer 12

Response

Status 200 OK

Body

{
  "id": 12,
  "direction": "out",
  "moved_on": "2023-08-21",
  "quantity_change": "980.0",
  "purchase_price": "1273.474",
  "purchase_currency": "CZK",
  "native_purchase_price": "1273.474",
  "retail_price": "2528.0",
  "retail_currency": "CZK",
  "native_retail_price": "2528.0",
  "private_note": null,
  "inventory_item_id": 1,
  "document": {
    "id": 540,
    "type": "Invoice",
    "line_id": 1298
  },
  "created_at": "2023-09-05T13:26:20.968+02:00",
  "updated_at": "2023-09-05T13:26:20.968+02:00"
}

Create Inventory Move

  • If inventory move is successfuly created the server will respond with 201 Created and a JSON body with its data. A Location header will also be returned which contains a link to the newly created move.
  • Request with invalid data will result in response 422 Unprocessable Entity with a JSON body describing errors found in the request.

Request

POST https://app.fakturoid.cz/api/v3/accounts/{slug}/inventory_items/{inventory_item_id}/inventory_moves.json

Headers

Name Value
User-Agent YourApp (yourname@example.com)
Content-Type application/json

URL Parameters

Name Description Type Example
slug Account name String applecorp
inventory_item_id Inventory item ID Integer 1

Body

{
  "direction": "in",
  "moved_on": "2023-11-10",
  "quantity_change": "35",
  "purchase_price": "50"
}

Response

Status 201 Created

Headers

Name Value
Location https://app.fakturoid.cz/api/v3/accounts/applecorp/inventory_items/1/inventory_moves/56.json

Body

{
  "id": 51,
  "direction": "in",
  "moved_on": "2023-11-10",
  "quantity_change": "35.0",
  "purchase_price": "50.0",
  "purchase_currency": null,
  "native_purchase_price": "50.0",
  "retail_price": null,
  "retail_currency": "CZK",
  "native_retail_price": null,
  "private_note": null,
  "inventory_item_id": 1,
  "document": null,
  "created_at": "2023-11-10T15:47:46.269+01:00",
  "updated_at": "2023-11-10T15:47:46.269+01:00"
}

Request with invalid data

Body

{
  "direction": "in",
  "moved_on": "2023-11-10",
  "quantity_change": "35"
}

Response

Status 422 Unprocessable Entity

Body

{
  "errors": {
    "purchase_price": [
      "can't be blank"
    ]
  }
}

Update Inventory Move

  • If the inventory move is successfuly updated the server will respond with 200 OK and a JSON body with its data.
  • Request with invalid data will result in response 422 Unprocessable Entity with a JSON body describing errors found in the request.
  • When editing a move that is assigned to a document, you will receive 403 Forbidden from the server.

Request

PATCH https://app.fakturoid.cz/api/v3/accounts/{slug}/inventory_items/{inventory_item_id}/inventory_moves/{id}.json

Headers

Name Value
User-Agent YourApp (yourname@example.com)
Content-Type application/json

URL Parameters

Name Description Type Example
slug Account name String applecorp
inventory_item_id Inventory item ID Integer 1
id Inventory move ID Integer 51

Body

{
  "direction": "in",
  "moved_on": "2023-11-10",
  "quantity_change": "55",
  "purchase_price": "100"
}

Response

Status 200 OK

Body

{
  "id": 51,
  "direction": "in",
  "moved_on": "2023-11-10",
  "quantity_change": "55.0",
  "purchase_price": "100.0",
  "purchase_currency": null,
  "native_purchase_price": "50.0",
  "retail_price": null,
  "retail_currency": "CZK",
  "native_retail_price": null,
  "private_note": null,
  "inventory_item_id": 1,
  "document": null,
  "created_at": "2023-11-10T15:47:46.269+01:00",
  "updated_at": "2023-11-10T16:00:08.073+01:00"
}

Request with invalid data

Body

{
  "direction": "1"
}

Response

Status 422 Unprocessable Entity

Body

{
  "errors": {
    "direction": [
      "is not included in the list",
      "cannot be changed"
    ]
  }
}

Delete Inventory Move

After deleting a move the server will respond with 204 No Content.

When deleting a move that is assigned to a document, you will receive 403 Forbidden from the server.

Request

DELETE https://app.fakturoid.cz/api/v3/accounts/{slug}/inventory_items/{inventory_item_id}/inventory_moves/{id}.json

Headers

Name Value
User-Agent YourApp (yourname@example.com)

URL Parameters

Name Description Type Example
slug Account name String applecorp
inventory_item_id Inventory item ID Integer 1
id Inventory move ID Integer 51

Response

Status 204 No Content