(Quick Reference)
56 Loadings - Reference Documentation
Version: 2.1
56 Loadings
56.1 List
Service: List loadings
Description: This web service returns a json list of loadings.
URL:
https://BASE_URL/api/VERSION/loadings
Method: GET
Parameters:
Pagination parameters:
Name | Description | Type | Required | Possible values |
---|
max | Limits the number of resources requested to return. | Integer | no | |
offset | Tells where to start returning records from the entire set of results. | Integer | no | |
order | Orders ascending or descending. | Integer | no | asc,desc |
sort | Orders the results by the specified field. | String | no | |
The
max
parameter is set to
100
by default.
Filters parameters:
Name | Description | Type | Required | Example values |
---|
dateCreated_gt | Filters by the resource's creation date time and operator greater than | Date | no | 2016-08-15T14:52:48Z |
dateCreated_gte | Filters by the resource's creation date time and operator greater than or equal | Date | no | |
dateCreated_lt | Filters by the resource's creation date time and operator less than | Date | no | |
dateCreated_lte | Filters by the resource's creation date time and operator less than or equal | Date | no | |
lastUpdated_gt | Filters by the resource's last-modified date time and operator greater than | Date | no | |
lastUpdated_gte | Filters by the resource's last-modified date time and operator greater than or equal | Date | no | |
lastUpdated_lt | Filters by the resource's last-modified date time and operator less than | Date | no | |
lastUpdated_lte | Filters by the resource's last-modified date time and operator less than or equal | Date | no | |
reference | Wildcard search by the resource's reference | String | no | reference=Ref-6* , reference=*ef-6 , reference=*ef-6* |
Dates should be formatted as the ISO-8601 format (YYYY-MM-DDTHH:MM:SSZ)
Success Output
Status: HTTP/1.1 200 OK
{
"paging": {
"total": 51,
"max": 5,
"offset": 0,
"previous": null,
"next": "/api/v1.0/loadings?max=5&offset=5&sort=dateCreated&order=asc"
},
"data": [
{
"id": 3,
"reference": "10Crates",
"warehouseReference": "entrepotA",
"warehouse": {
"id": 4,
"reference": "entrepotA",
"name": "entrepot A",
"href": "/api/v1.0/warehouses/4"
},
"warehouseType": "1",
"reason": {
"id": 2,
"name": "whse transaction",
"href": "/api/v1.0/reasons/2"
},
"type": "1",
"status": "1",
"loadingDetails": [
{
"id": 8,
"itemId": 495,
"unitId": 1,
"quantity": 7,
"realAvailableQty": null,
"availableQty": null,
"href": "/api/v1.0/loadingDetails/8"
}
],
"organization": "entity1",
"dateCreated": "2016-01-25T16:27:33Z",
"lastUpdated": "2016-01-25T16:27:33Z"
},
…
]
}
Failure Output
Status: HTTP/1.1 400 Bad Request
{
"error": "invalid_param",
"error_description": "The parameters [dateCreated_gta] you provided are not valid for this request."
}
56.2 Show
Service: Show a loading
Description: Returns the requested loading in json format when successful. Returns a json response, describing the failure condition when unsuccessful.
URL:
https://BASE_URL/api/VERSION/loadings/{id}
URL with external_id:
https://BASE_URL/api/VERSION/loadings/reference/{id}
Method: GET
Parameters:
Name | Description | Type | Required | Example values |
---|
id | The ID of the desired loading | Long/String | yes | 123 |
Success Output
Status: HTTP/1.1 200 OK
{
"id": 3,
"reference": "10Crates",
"warehouseReference": "entrepotA",
"warehouse": {
"id": 4,
"reference": "entrepotA",
"name": "entrepot A",
"href": "/api/v1.0/warehouses/4"
},
"warehouseType": "1",
"reason": {
"id": 2,
"name": "whse transaction",
"href": "/api/v1.0/reasons/2"
},
"type": "1",
"status": "1",
"loadingDetails": [
{
"id": 8,
"itemId": 495,
"unitId": 1,
"quantity": 7,
"realAvailableQty": null,
"availableQty": null,
"href": "/api/v1.0/loadingDetails/8"
}
],
"organization": "entity1",
"dateCreated": "2016-01-25T16:27:33Z",
"lastUpdated": "2016-01-25T16:27:33Z"
}
Failure Output
Status: HTTP/1.1 404 Not Found
{
"error": "not_found",
"error_description": "The loading with the id 389 doesn't exist."
}
56.3 Create
Service: Create a loading
Description: Returns the created loading in json format when successful. Returns a json response, describing the failure condition when unsuccessful.
URL:
https://BASE_URL/api/VERSION/loadings
Method: POST
Request content type: application/json
Parameters:
Name | Description | Type | Required | Example values |
---|
reference | | String | yes | |
warehouseId | | Long/String | yes | |
type | Should be equal to 1 for loading or 2 for unloading | Integer | yes | 1,2 |
reasonId | Id of reason with type "3" ( warehouse transaction) | Integer | no | |
useExternalId | By default, it is set to false. set it to true if you want to use external ids. | Boolean | no | true , false |
Loading details parameter :
Parameter name:
loadingDetails
Parameter type: a json structure
Name | Description | Type | Required | Example values |
---|
itemUnitId | | Integer | yes | |
quantity | | Integer | yes | |
serialNumbers | List of serial numbers id | JSON list | no | [750,711] |
realQty | The real available quantity in van stock, used when van unloading, by default, it is fixed to the available quantity. | integer | no | 20 |
Serial numbers parameter is only used when van loading
For each loaded item, serial numbers are accepted with only one item unit.
If realQty parameter is specified, system will calculate the availability of requested quantity in relation to the real available quantity in van stock
Example:
{
"reference": "10Crates",
"warehouseId": 2,
"type": 1,
"loadingDetails": [{
"itemUnitId": 1,
"quantity": 10
}]
}
Success Output
Status: HTTP/1.1 201 Created
{
"id": 3,
"reference": "10Crates",
"warehouseReference": "entrepotA",
"warehouse": {
"id": 4,
"reference": "entrepotA",
"name": "entrepot A",
"href": "/api/v1.0/warehouses/4"
},
"warehouseType": "1",
"reason": {
"id": 2,
"name": "whse transaction",
"href": "/api/v1.0/reasons/2"
},
"type": "1",
"status": "1",
"loadingDetails": [
{
"id": 8,
"itemId": 495,
"unitId": 1,
"quantity": 10,
"realAvailableQty": null,
"availableQty": null,
"href": "/api/v1.0/loadingDetails/8"
}
],
"organization": "entity1",
"dateCreated": "2016-01-25T16:27:33Z",
"lastUpdated": "2016-01-25T16:27:33Z"
}
Failure Output
Status: HTTP/1.1 400 Bad Request
{
"error": "not_unique",
"error_description": "reference already used"
}
{
"error": "invalid_param_type",
"error_description": "The type of parameter warehouseId you provided is not valid for this request."
}
{
"error": "quantity_not_available",
"error_description": "Quantity should be less than or equal to the available quantity"
}
{
"error": "invalid_serial_number",
"error_description": "The number of serial codes should be equal to the reserved quantity"
}
{
"error": "invalid_serial_status",
"error_description": "The serial number status with id 2704563 is not equal to new."
}
{
"error": "invalid_param_type",
"error_description": "The type of parameter serial number id you provided is not valid for this request."
}
Status: HTTP/1.1 404 Not Found
{
"error": "not_found",
"error_description": "The warehouse with the id 707 doesn't exist."
}
{
"error": "not_found",
"error_description": "The reason with the id 25 doesn't exist."
}
{
"error": "not_found",
"error_description": "The serial number with the id 1 doesn't exist."
}
56.4 Update
Service: Update a loading
Description: Returns the updated loading in json format when successful. Returns a json response, describing the failure condition when unsuccessful.
URL:
https://BASE_URL/api/VERSION/loadings/{id}
URL with external_id:
https://BASE_URL/api/VERSION/loadings/reference/{id}
Method: PUT
Request content type: application/json
Parameters:
Name | Description | Type | Required | Example values |
---|
id | The ID of the desired loading | Long/String | yes | 123 |
reference | | String | yes | |
warehouseId | | Long/String | yes | |
type | Should be equal to 1 for loading or 2 for unloading | Integer | yes | 1,2 |
reasonId | id of reason with type "3" ( warehouse transaction) | Integer | no | |
Loading details parameter :
Parameter name:
loadingDetails
Parameter type: a json structure
Name | Description | Type | Required | Example values |
---|
itemUnitId | | Integer | yes | |
quantity | | Integer | yes | |
serialNumbers | List of serial numbers id | JSON list | no | [750,711] |
realQty | The real available quantity in van stock, used when van unloading, by default, it is fixed to the available quantity. | integer | no | 20 |
Serial numbers is only used when van loading
For each loaded item, serial numbers are accepted with only one item unit.
If realQty parameter is specified, system will calculate the availability of requested quantity in relation to the real available quantity in van stock
Example:
{
"reference": "10Crates",
"warehouseId": 2,
"type": 1,
"loadingDetails": [{
"itemUnitId": 1,
"quantity": 10
}]
}
Success Output
Status: HTTP/1.1 200 OK
{
"id": 3,
"reference": "10Crates",
"warehouseReference": "entrepotA",
"warehouse": {
"id": 4,
"reference": "entrepotA",
"name": "entrepot A",
"href": "/api/v1.0/warehouses/4"
},
"warehouseType": "1",
"reason": {
"id": 2,
"name": "whse transaction",
"href": "/api/v1.0/reasons/2"
},
"type": "1",
"status": "1",
"loadingDetails": [
{
"id": 8,
"itemId": 495,
"unitId": 1,
"quantity": 10,
"realAvailableQty": null,
"availableQty": null,
"href": "/api/v1.0/loadingDetails/8"
}
],
"organization": "entity1",
"dateCreated": "2016-01-25T16:27:33Z",
"lastUpdated": "2016-01-25T17:27:33Z"
}
Failure Output
Status: HTTP/1.1 404 Not Found
{
"error": "not_found",
"error_description": "The loading with the id 707 doesn't exist."
}
{
"error": "not_found",
"error_description": "The warehouse with the id 707 doesn't exist."
}
{
"error": "not_found",
"error_description": "The reason with the id 25 doesn't exist."
}
{
"error": "not_found",
"error_description": "The serial number with the id 1 doesn't exist."
}
Status: HTTP/1.1 400 Bad Request
{
"error": "not_unique",
"error_description": "reference already used"
}
{
"error": "invalid_param_type",
"error_description": "The type of parameter warehouseId you provided is not valid for this request."
}
{
"error": "quantity_not_available",
"error_description": "Quantity should be less than or equal to the available quantity"
}
{
"error": "invalid_param_type",
"error_description": "The type of parameter serial number id you provided is not valid for this request."
}
{
"error": "invalid_serial_status",
"error_description": "The serial number status with id 2704563 is sold, or already reserved in another loading."
}
{
"error": "invalid_serial_number",
"error_description": "The number of serial codes should be equal to the reserved quantity"
}
56.5 Upsert
Service: Upsert a loading
Description: This web service is used to insert a loading object to the database if it does not already exist, or update it.
URL with external_id:
https://BASE_URL/api/VERSION/loadings/reference/{id}
Method: POST
Request content type: application/json
Parameters:
Name | Description | Type | Required | Example values |
---|
reference | | String | yes | |
warehouseId | | String | yes | |
type | Should be equal to 1 for loading or 2 for unloading | Integer | yes | 1,2 |
reasonId | Id of reason with type "3" ( warehouse transaction) | Integer | no | |
Loading details parameter :
Parameter name:
loadingDetails
Parameter type: a json structure
Name | Description | Type | Required | Example values |
---|
itemUnitId | | Integer | yes | |
quantity | | Integer | yes | |
serialNumbers | List of serial numbers id | JSON list | no | [750,711] |
realQty | The real available quantity in van stock, used when van unloading, by default, it is fixed to the available quantity. | integer | no | 20 |
Serial numbers parameter is only used when van loading
For each loaded item, serial numbers are accepted with only one item unit.
If realQty parameter is specified, system will calculate the availability of requested quantity in relation to the real available quantity in van stock
Example:
{
"reference": "10Crates",
"warehouseId": 2,
"type": 1,
"loadingDetails": [{
"itemUnitId": 1,
"quantity": 10
}]
}
Success Output
Status: HTTP/1.1 201 Created
{
"id": 3,
"reference": "10Crates",
"warehouseReference": "entrepotA",
"warehouse": {
"id": 4,
"reference": "entrepotA",
"name": "entrepot A",
"href": "/api/v1.0/warehouses/4"
},
"warehouseType": "1",
"reason": {
"id": 2,
"name": "whse transaction",
"href": "/api/v1.0/reasons/2"
},
"type": "1",
"status": "1",
"loadingDetails": [
{
"id": 8,
"itemId": 495,
"unitId": 1,
"quantity": 10,
"realAvailableQty": null,
"availableQty": null,
"href": "/api/v1.0/loadingDetails/8"
}
],
"organization": "entity1",
"dateCreated": "2016-01-25T16:27:33Z",
"lastUpdated": "2016-01-25T16:27:33Z"
}
Failure Output
Status: HTTP/1.1 400 Bad Request
{
"error": "not_unique",
"error_description": "reference already used"
}
{
"error": "invalid_param_type",
"error_description": "The type of parameter warehouseId you provided is not valid for this request."
}
{
"error": "quantity_not_available",
"error_description": "Quantity should be less than or equal to the available quantity"
}
{
"error": "invalid_serial_number",
"error_description": "The number of serial codes should be equal to the reserved quantity"
}
{
"error": "invalid_serial_status",
"error_description": "The serial number status with id 2704563 is not equal to new."
}
{
"error": "invalid_param_type",
"error_description": "The type of parameter serial number id you provided is not valid for this request."
}
Status: HTTP/1.1 404 Not Found
{
"error": "not_found",
"error_description": "The warehouse with the id 707 doesn't exist."
}
{
"error": "not_found",
"error_description": "The reason with the id 25 doesn't exist."
}
{
"error": "not_found",
"error_description": "The serial number with the id 1 doesn't exist."
}
56.6 Delete
Service: Delete a loading
Description: Returns a json response.
URL:
https://BASE_URL/api/VERSION/loadings/{id}
URL with external_id:
https://BASE_URL/api/VERSION/loadings/reference/{id}
Method: DELETE
Parameters:
Name | Description | Type | Required | Example values |
---|
id | The ID of the desired loading | Long/String | yes | 123 |
Success Output
Status: HTTP/1.1 200 OK
{
"success": "true",
"success_description": "Instance deleted successfully"
}
Failure Output
Status: HTTP/1.1 400 Bad Request
{
"error": "delete_failed",
"error_description": "Failed to delete instance."
}
Status: HTTP/1.1 404 Not Found
{
"error": "not_found",
"error_description": "The loading with the id 706 doesn't exist."
}