General information on Fortnox Lager

What is Fortnox Lager?

Fornox Lager is a Warehouse application, which can be added as a part of the Fortnox
application suite.
Before it can be used it must be activated by a user that is a System administrator, this
action can not be done via API.
As a part of the activation process current stock balances are transferred from the item
register to the Warehouse application, which henceforth will keep track of it.
Fortnox Lager uses FIFO (First In First Out) principle.

Functionality in Fortnox Lager

Fortnox Lager has a growing number of features. For an updated list, visit

www.fortnox.se/program/fortnox-lager

“WarehouseReady”

A document is set to “WarehouseReady” when it’s content that relates to Warehouse is final.
This action locks the document, and it’s also an indicator that the stock changes can be
booked (which is done via an automatic job each night).
For inbound deliveries, the WarehouseReady-state is also used to commit the deliveries to
the warehouse, thus increasing stock balance and value.

Stock balances, value and bookkeeping

When Fortnox Lager is used, all changes to stock balance is done via either outbound
delivery (e.g. Customer Order, Customer invoice) which reduces quantity in stock, or
inbound delivery (e.g. Supplier invoice, Manual inbound) which increases quantity in stock.
When a document is set to “WarehouseReady”, all information affecting Warehouse is
locked on the document. An automatic bookkeeping job is run every night and will book all
changes made by such documents.
An inbound delivery is defined with (at least) item, quantity, and a cost/p in SEK. The
quantity will be available in stock when the document is set to WarehouseReady. At the
same time the value will be added to the stock value when the inbound document is set to
WarehouseReady.
An outbound delivery will affect the stock balance as soon as it’s saved. It can have one of
three possible states:
●Registered (does not allocate any items).
●Reservation (only affecting available stock).

●Delivery (affecting quantity in stock and stock value).

Reservation/Delivery of items is always done according to FIFO-principle.
When set to WarehouseReady the document will be locked in the same way as an inbound
delivery, also being subject to automatic bookkeeping.

Stock point and Stock locations

Stock point and locations are optional concepts to use in Fortnox Lager. A stock point
represents a physical warehouse, e.g. in a specific city. A stock location is a place on a stock
point, e.g. a specific shelf.
An inbound delivery can be made without specifying stock point. It will then get the global
default stock point as set in Fortnox Lager, or default Stock point and location (if set on the
specific item).
If you specify stock point you can also (optionally) specify a stock location on that stock
point. The inbound delivery will then reside on that stock point (and location if used).
When making an outbound delivery you can optionally specify a stock point. If you do, items
will be allocated from that stock point only, applying FIFO on items available on that stock
point.
If stock point is not specified on an outbound delivery, items will be allocated from any stock
point according to FIFO.

What is “Custom documents”?

General
The feature to support “Custom documents” has been developed in order to allow integration
solutions to make their own inbound- and outbound deliveries affecting warehouse, without
using any of the existing Fortnox documents, such as e.g. Customer invoice or Manual
deliveries.
This allows an integrating solution to have their own documents with unique names and
identifiers, performing the same kind of transactions in Warehouse as with the standard
documents. This results in flexibility for the integrating solution, as well as traceability of
changes to stock balances and value.
The same rules applies to these documents as to Fortnox documents; Inbounds will become
available once marked WarehouseReady.
Outbound will affect stock balance immediately
(with reservations or deliveries). When marked WarehouseReady the documents will be
locked, only allowing Void as possible action.

NOTE1: A custom document must be defined as an inbound OR outbound document.

Typically separate document names are used when defining an inbound or outbound
document (as in e.g. “Manual inbound delivery” and “Manual outbound delivery”.
NOTE2: Documents may be called almost anything. Only limitation is a number of names
that Fortnox has reserved for internal use (you’ll get
“400 Bad Request”
“validation.referencetypenotallowed”​
if you use one of the reserved names).

Inbound documents

An inbound document can contain a number of items with specified quantity and cost. The
total cost (value) will be added to the Warehouse once marked WarehouseReady, and automatically booked the following night.
NOTE: If you use a negative quantity on a row on an inbound document, it will result in an
outbound delivery for that row (e.g. as creating a credit-row on a Supplier invoice).

Outbound documents

When the document is saved as a Reservation it must include a quantity to Warehouse.
Warehouse will return a Reserved quantity, based on what could be allocated.
Also when the document is saved as a Delivery the document shall include a quantity. In this
case it can be set to any quantity. If using the parameter Forced delivery = True, the
requested Quantity will always be delivered, even if it results in a negative stock balance. If
Forced delivery = False it is only possible to deliver as many as are available to allocate at
the time.
When marked with WarehouseReady the outbound deliveries will be automatically booked
the following night.
NOTE: If you use a negative quantity on a row on an outbound document, it will result in an
inbound delivery for that row (e.g. as creating a credit-row on a Customer invoice).

Custom Inbound Document

URL

api/warehouse/documentdeliveries/custom/inbound-v1

{
"apiVersion" : "1.0.0-SNAPSHOT",
"swaggerVersion" : "1.2",
"basePath" : "http://apps-develop.alfa.fortnox.local",
"resourcePath" : "/api/warehouse/documentdeliveries/custom/inbound-v1",
"apis" : [ {
"path" : "/api/warehouse/documentdeliveries/custom/inbound-v1/{type}/{id}",
"operations" : [ {
"method" : "GET",
"nickname" : "get",
"type" : "CustomInboundDocument",
"parameters" : [ {
"type" : "string",
"description" : "document type",
"paramType" : "path",
"name" : "type",
"required" : true
}, {
"type" : "string",
"description" : "document id",
"paramType" : "path",
"name" : "id",
"required" : true
} ],
"summary" : "Get a custom inbound document.",
"consumes" : [ "application/json" ],
"produces" : [ "application/json" ]
}, {
"method" : "PUT",
"nickname" : "save",
"type" : "CustomInboundDocument",
"parameters" : [ {
"type" : "string",
"description" : "min 1 character, max 25 characters, may contain letters A-Z, digits 0-9, underscore (_), and dash (-), type is case-insensitive\n <blockquote><pre>\n Type is a custom name/reference of the document that will be used to reference the document type <br>\n * If type is not known, it will be registered as belonging to the INBOUND category. <br>\n * If type is an existing custom document type of category OUTBOUND an error is thrown. <br>\n * If type is invalid an error is thrown. <br>\n </pre></blockquote>",
"paramType" : "path",
"name" : "type",
"required" : true
}, {
"type" : "string",
"description" : "min 1 character, max 25 characters, may only contain digits 0-9",
"paramType" : "path",
"name" : "id",
"required" : true
}, {
"type" : "CustomInboundDocument",
"description" : "the {@link CustomInboundDocument} to create",
"paramType" : "body",
"name" : "document",
"required" : true
} ],
"summary" : "Save a custom inbound document.",
"consumes" : [ "application/json" ],
"produces" : [ "application/json" ]
} ]
}, {
"path" : "/api/warehouse/documentdeliveries/custom/inbound-v1/{type}/{id}/release",
"operations" : [ {
"method" : "PUT",
"nickname" : "release",
"type" : "Void",
"parameters" : [ {
"type" : "string",
"description" : "document type",
"paramType" : "path",
"name" : "type",
"required" : true
}, {
"type" : "string",
"description" : "document id",
"paramType" : "path",
"name" : "id",
"required" : true
} ],
"summary" : "Release custom inbound document.",
"consumes" : [ "application/json" ],
"produces" : [ "application/json" ]
} ]
}, {
"path" : "/api/warehouse/documentdeliveries/custom/inbound-v1/{type}/{id}/void",
"operations" : [ {
"method" : "PUT",
"nickname" : "voidDocument",
"type" : "Void",
"parameters" : [ {
"type" : "string",
"description" : "document type",
"paramType" : "path",
"name" : "type",
"required" : true
}, {
"type" : "string",
"description" : "document id",
"paramType" : "path",
"name" : "id",
"required" : true
}, {
"type" : "boolean",
"description" : "true if the document should be voided even if the document has connected outbounds, defaults to false.",
"paramType" : "query",
"name" : "force"
} ],
"summary" : "Void custom inbound document.",
"notes" : "Voiding a document will undo the possible stock changes that the document had made,\n note that the document and the transactions created are not deleted. Some limitations apply, see below.",
"consumes" : [ "application/json" ],
"produces" : [ "application/json" ]
} ]
} ],
"models" : {
"CustomInboundDocument" : {
"id" : "CustomInboundDocument",
"properties" : {
"id" : {
"type" : "string",
"description" : "id"
},
"type" : {
"type" : "string",
"description" : "type"
},
"date" : {
"type" : "string",
"format" : "date",
"description" : "date"
},
"currency" : {
"type" : "Currency",
"description" : "currency"
},
"note" : {
"type" : "string",
"description" : "note"
},
"warehouseReady" : {
"type" : "boolean",
"description" : "true if this document is released, false otherwise"
},
"voided" : {
"type" : "boolean",
"description" : "true if document is voided, false otherwise"
},
"rows" : {
"type" : "array",
"description" : "rows",
"items" : {
"$ref" : "CustomInboundDocumentRow"
}
}
},
"required" : [ "date" ]
},
"CustomInboundDocumentRow" : {
"id" : "CustomInboundDocumentRow",
"properties" : {
"rowId" : {
"type" : "integer",
"format" : "int64",
"description" : "row id"
},
"itemId" : {
"type" : "string",
"description" : "item id"
},
"quantity" : {
"type" : "number",
"format" : "double",
"description" : "quantity"
},
"directCost" : {
"type" : "number",
"format" : "double",
"description" : "direct cost per piece",
"minimum" : "0"
},
"freightCost" : {
"type" : "number",
"format" : "double",
"description" : "freight cost per piece",
"minimum" : "0"
},
"otherCost" : {
"type" : "number",
"format" : "double",
"description" : "other cost per piece",
"minimum" : "0"
},
"batch" : {
"type" : "string",
"description" : "batch"
},
"stockPointId" : {
"type" : "string",
"format" : "uuid",
"description" : "stock point id"
},
"stockPointCode" : {
"type" : "string",
"description" : "stock point code"
},
"stockLocationId" : {
"type" : "string",
"format" : "uuid",
"description" : "stock point id"
},
"stockLocationCode" : {
"type" : "string",
"description" : "stock location code"
},
"costCenterCode" : {
"type" : "string",
"description" : "cost center code"
},
"projectId" : {
"type" : "string",
"description" : "project id"
},
"itemDescription" : {
"type" : "string",
"description" : "description"
},
"itemUnit" : {
"type" : "string",
"description" : "unit"
}
},
"required" : [ "itemId", "quantity" ]
},
"Currency" : {
"id" : "Currency",
"properties" : {
"currency" : {
"type" : "string"
},
"rate" : {
"type" : "number",
"format" : "double",
"minimum" : "0.001"
},
"unit" : {
"type" : "integer",
"format" : "int32"
}
},
"required" : [ "currency", "rate" ]
}
},
"info" : {
"title" : "warehouse-documentdeliveries-api",
"description" : ""
}
}

Custom Outbound Document

URL

/api/warehouse/documentdeliveries/custom/outbound-v1/{type}/{id}

{
"apiVersion" : "1.0.0-SNAPSHOT",
"swaggerVersion" : "1.2",
"basePath" : "http://apps-develop.alfa.fortnox.local",
"resourcePath" : "/api/warehouse/documentdeliveries/custom/outbound-v1",
"apis" : [ {
"path" : "/api/warehouse/documentdeliveries/custom/outbound-v1/{type}/{id}",
"operations" : [ {
"method" : "GET",
"nickname" : "get",
"type" : "CustomOutboundDocument",
"parameters" : [ {
"type" : "string",
"description" : "document type",
"paramType" : "path",
"name" : "type",
"required" : true
}, {
"type" : "string",
"description" : "document id",
"paramType" : "path",
"name" : "id",
"required" : true
} ],
"summary" : "Get custom outbound document.",
"consumes" : [ "application/json" ],
"produces" : [ "application/json" ]
}, {
"method" : "PUT",
"nickname" : "save",
"type" : "CustomOutboundDocument",
"parameters" : [ {
"type" : "string",
"description" : "the type of the custom outbound document, min 1 character, max 25 characters, may contain letters A-Z, digits 0-9, underscore (_), and dash (-). Always stored as upper case.",
"paramType" : "path",
"name" : "type",
"required" : true
}, {
"type" : "string",
"description" : "the id of the custom outbound document, min 1 character, max 25 characters, may only contain digits 0-9",
"paramType" : "path",
"name" : "id",
"required" : true
}, {
"type" : "CustomOutboundDocument",
"description" : "the {@link CustomOutboundDocument} to create",
"paramType" : "body",
"name" : "document",
"required" : true
} ],
"summary" : "Save a custom outbound document.",
"notes" : "<br>\n If type is not known, it will be registered as belonging to the OUTBOUND category.<br>\n If type is an existing custom document type of category INBOUND an error is thrown.<br>\n If type is invalid an error is thrown.<br>",
"consumes" : [ "application/json" ],
"produces" : [ "application/json" ]
} ]
}, {
"path" : "/api/warehouse/documentdeliveries/custom/outbound-v1/{type}/{id}/release",
"operations" : [ {
"method" : "PUT",
"nickname" : "release",
"type" : "Void",
"parameters" : [ {
"type" : "string",
"description" : "document type",
"paramType" : "path",
"name" : "type",
"required" : true
}, {
"type" : "string",
"description" : "document id",
"paramType" : "path",
"name" : "id",
"required" : true
} ],
"summary" : "Release custom outbound document.",
"consumes" : [ "application/json" ],
"produces" : [ "application/json" ]
} ]
}, {
"path" : "/api/warehouse/documentdeliveries/custom/outbound-v1/{type}/{id}/void",
"operations" : [ {
"method" : "PUT",
"nickname" : "voidDocument",
"type" : "Void",
"parameters" : [ {
"type" : "string",
"description" : "document type",
"paramType" : "path",
"name" : "type",
"required" : true
}, {
"type" : "string",
"description" : "document id",
"paramType" : "path",
"name" : "id",
"required" : true
}, {
"type" : "boolean",
"description" : "true if the document should be voided even if the document has connected outbounds, defaults to false.",
"paramType" : "query",
"name" : "force"
} ],
"summary" : "Void custom outbound document.",
"consumes" : [ "application/json" ],
"produces" : [ "application/json" ]
} ]
} ],
"models" : {
"CustomOutboundDocument" : {
"id" : "CustomOutboundDocument",
"properties" : {
"id" : {
"type" : "string",
"description" : "id"
},
"referenceType" : {
"type" : "string",
"description" : "type"
},
"date" : {
"type" : "string",
"format" : "date",
"description" : "date"
},
"note" : {
"type" : "string",
"description" : "note"
},
"warehouseReady" : {
"type" : "boolean",
"description" : "true if this document is released, false otherwise"
},
"forcedDelivery" : {
"type" : "boolean",
"description" : "true if this document should be able to cause negative stock balance"
},
"voided" : {
"type" : "boolean",
"description" : "true if document is voided, false otherwise"
},
"averageCosts" : {
"type" : "array",
"description" : "list of average costs",
"items" : {
"$ref" : "AverageCost"
}
},
"rows" : {
"type" : "array",
"description" : "rows",
"items" : {
"$ref" : "CustomOutboundDocumentRow"
}
},
"deliveryState" : {
"type" : "string",
"description" : "registration, no reservations are made; reservation, if stock is reserved for this document; or delivery for delivered stock.",
"enum" : [ "registration", "reservation", "delivery" ]
}
},
"required" : [ "date", "deliveryState" ]
},
"AverageCost" : {
"id" : "AverageCost",
"properties" : {
"itemId" : {
"type" : "string"
},
"stockPointId" : {
"type" : "string",
"format" : "uuid"
},
"averageCostInSEK" : {
"type" : "number",
"format" : "double"
}
},
"required" : [ "itemId", "averageCostInSEK" ]
},
"CustomOutboundDocumentRow" : {
"id" : "CustomOutboundDocumentRow",
"properties" : {
"rowId" : {
"type" : "integer",
"format" : "int64",
"description" : "row id"
},
"itemId" : {
"type" : "string",
"description" : "item id"
},
"quantity" : {
"type" : "number",
"format" : "double",
"description" : "quantity"
},
"stockPointId" : {
"type" : "string",
"format" : "uuid",
"description" : "requested stock point id"
},
"stockLocationId" : {
"type" : "string",
"format" : "uuid",
"description" : "requested stock location"
},
"costCenterCode" : {
"type" : "string",
"description" : "cost center code"
},
"projectId" : {
"type" : "string",
"description" : "project id"
},
"itemDescription" : {
"type" : "string",
"description" : "description"
},
"itemUnit" : {
"type" : "string",
"description" : "unit"
},
"reservedQuantity" : {
"type" : "number",
"format" : "double",
"description" : "reserved quantity"
},
"deliveredQuantity" : {
"type" : "number",
"format" : "double",
"description" : "delivered quantity"
},
"forcedQuantity" : {
"type" : "number",
"format" : "double",
"description" : "forced quantity"
}
},
"required" : [ "itemId", "quantity" ]
}
},
"info" : {
"title" : "warehouse-documentdeliveries-api",
"description" : ""
}
}