GET

Description

Get a custom inbound document

Method

GET

Version

API

Parameters

Type

Document type
Type is a custom name/reference of the document that is used to reference the document type

Id

Document Id

Exceptions

WebException – NOT_FOUND

If the document does not exist

WebException – BAD_REQUEST

referenceTypeNotAllowed – If type is not allowed to be used

Response

{  
   "id":"1",
   "type":"type",
   "date":"2018-10-22",
   "currency":{  
      "currency":"SEK",
      "rate":1,
      "unit":1
   },
   "note":"This is a note",
   "warehouseReady":true,
   "voided":true,
   "rows":[  
      {  
         "rowId":1,
         "itemId":"anItem",
         "quantity":1,
         "directCost":10,
         "freightCost":5,
         "otherCost":2,
         "batch":"001/SE",
         "stockPointId":"0add3abf-7969-449b-8ee5-211e3d3f4be3",
         "stockPointCode":"Standardlagerställe",
         "stockLocationId":"cdcddfad-1272-4b82-8242-35f9ac59d8ab",
         "stockLocationCode":"Standardlagerplats",
         "costCenterCode":"Kostnadställe 1",
         "projectId":"Projekt 1",
         "itemDescription":"an item that we use",
         "itemUnit":"st"
      }
   ]
}

SAVE

Description

Save a custom inbound document

Method

PUT

Version

API

Parameters

Type

Document type
min 1 character, max 25 characters, may contain letters A-Z, digits 0-9, underscore (_), and dash (-), type is case-insensitive

Type is a custom name/reference of the document that will be used to reference the document type
* If type is not known, it will be registered as belonging to the INBOUND category.
* If type is an existing custom document type of category OUTBOUND an error is thrown.
* If type is invalid an error is thrown.

Id

Document id
min 1 character, max 25 characters, may only contain digits 0-9

Exceptions

WebException – BAD_REQUEST

cannot_create_later_than_current_date – Document date cannot be in the future

referenceTypeAlreadyExists – If type is an existing custom document type of category OUTBOUND

referenceTypeNotAllowed – If type is not allowed to be used.

Validation exception(s) – If the document contains invalid data

Request

{
  "date": "2018-10-22",
  "currency": {
    "currency": "SEK",
    "rate": 1,
    "unit": 1
  },
  "note": "This is a note",
  "deliveryState": "delivery",
  "warehouseReady": true,
  "rows": [
    {
      "rowId": 1,
      "itemId": "anItem",
      "quantity": 1,
      "directCost": 10,
      "freightCost": 5,
      "otherCost": 2,
      "batch": "001/SE",
      "stockPointId": "0add3abf-7969-449b-8ee5-211e3d3f4be3",
      "stockPointCode": "Standardlagerställe",
      "stockLocationId": "cdcddfad-1272-4b82-8242-35f9ac59d8ab",
      "stockLocationCode": "Standardlagerplats",
      "costCenterCode": "Kostnadställe 1",
      "projectId": "Projekt 1",
      "itemDescription": "an item that we use",
      "itemUnit": "st"
    }
  ]
}

Response

{
  "id": {id},
  "type": {type},
  "date": "2018-10-22",
  "currency": {
    "currency": "SEK",
    "rate": 1,
    "unit": 1
  },
  "note": "This is a note",
  "warehouseReady": true,
  "voided": false,
  "rows": [
    {
      "rowId": 1,
      "itemId": "anItem",
      "quantity": 1,
      "directCost": 10,
      "freightCost": 5,
      "otherCost": 2,
      "batch": "001/SE",
      "stockPointId": "0add3abf-7969-449b-8ee5-211e3d3f4be3",
      "stockPointCode": "Standardlagerställe",
      "stockLocationId": "cdcddfad-1272-4b82-8242-35f9ac59d8ab",
      "stockLocationCode": "Standardlagerplats",
      "costCenterCode": "Kostnadställe 1",
      "projectId": "Projekt 1",
      "itemDescription": "an item that we use",
      "itemUnit": "st"
    }
  ]
}

RELEASE

Description

Release a custom inbound document

Method

PUT

Version

API

Parameters

Type

Document type
min 1 character, max 25 characters, may contain letters A-Z, digits 0-9, underscore (_), and dash (-), type is case-insensitive

Type is a custom name/reference of the document that will be used to reference the document type
* If type is invalid an error is thrown.

Id

Document id
min 1 character, max 25 characters, may only contain digits 0-9

Exceptions

WebException – BAD_REQUEST

document_is_voided – if the document is already voided

cannot_create_later_than_current_date – Document date cannot be in the future

referenceTypeNotAllowed – If type is not allowed to be used

period_locked – If Book keeping period is locked

Response

HTTP Status code 200 OK
HTTP Status code 400 Bad request
HTTP Status code 404 Not found

VOID

Description

Void custom inbound document. Voiding a document will undo the possible stock changes that the document had made,
note that the document and the transactions created are not deleted. Some limitations apply, see below.

Method

PUT

Version

API

Parameters

Type

Document type
min 1 character, max 25 characters, may contain letters A-Z, digits 0-9, underscore (_), and dash (-), type is case-insensitive

Type is a custom name/reference of the document that will be used to reference the document type
* If type is not known, it will be registered as belonging to the INBOUND category.
* If type is an existing custom document type of category OUTBOUND an error is thrown.
* If type is invalid an error is thrown.

Id

Document id
min 1 character, max 25 characters, may only contain digits 0-9

Force

Boolean
true if the document should be voided even if the document has connected outbounds, defaults to false.

Exceptions

WebException – BAD_REQUEST

void_linked_outbound – If this document has any outbounds transactions connected to it

referenceTypeNotAllowed – If type is not allowed to be used

Response

HTTP Status code 200 OK
HTTP Status code 400 Bad request
HTTP Status code 404 Not found

PROPERTIES

Custom Inbound Document

Property Description
id String, min length 1, max length 25
id of the document
type String, min length 1, max length 25
type of the document
date LocalDate
The date the document is created
currency Currency
The currency for this document. Defaults to SEK
note String, max length 1000
Optional note that can be attached to the document
warehouseready boolean
Warehouse ready status, a ready document is locked for changes, and prepared for book keeping
rows List<CustomInboundDocumentRow>
The document rows

Currency

Property Description
currency String, min and max length 3, cannot be null
Currency name / id i.e. SEK
rate BigDecimal, Min 0,001 cannot be null
currency rate
unit int, min 1
currency unit

CustomInboundDocumentRow

Property Description
rowId long, min 1L
The row id
itemId String min 1, max 50
the item id
quantity BigDecimal, default 0
Quantity of item
directCost BigDecimal, default 0
Direct costs
freightCost BigDecimal, default 0
Freight cost
otherCost BigDecimal, default 0
Other costs
batch String max 50
Batch number
stockPointId UUID, Not mandatory,
possible to use stockPointCode if the stock point id is unknown
stockPointCode String
The stock point code
stockLocationId UUID, Not mandatory,
possible to use stockLocationCode if the stock location id is unknown
stockLocationCode String
The stock location code
costCenterCode String, min 1, max 25, nullable
Code of the cost center
projectId String, min 1, max 25, nullable
Id of the project
itemDescription String max 200
Item description, not mandatory, item description from article will always override this.
itemUnit String max 50
item unit, not mandatory, item unit from article will always override this.