The related operation for the creation of inventory ledger entries is described.
Details of the request:
- Base URL: {host}/AFLSAPI/
- URI: /api/inventory/movement
-
Type: POST
-
Required headings:
- Content-Type: application/json
- X-Authorization: Bearer {Token}
URL Description
- {host}: It represents the domain of the environment in which the API is located.
- AFLSAPI/: Fixed API prefix.
- URI: Specific endpoint for the request.
⚐ EXAMPLE URL:
https://{host}/AFLSAPI/api/inventory/movement
Parameters:
| Name | Data type | Obligatory | Description |
|---|---|---|---|
| codeReference | String | No | Referral Code |
| Description | String | Yes | Description |
| locationId | Integer | Yes | Location ID |
| Productid | Integer | Yes | Product Identifier |
| quantity | Integer | Yes | Product quantity (For single type product the value must be 1) |
| serialNum | String | No | Product serial number (Required for single type product) |
| thirdId | String | No | Third-party identifier |
| typeMovement | Integer | Yes | Movement Type (1 - Input, 2 - Output) |
| unitValue | number | Yes | Unit value |
| workOrderId | Integer | No | Work Order Identifier (For Outbound Movement Type Only) |
Body of the petition:
The request consists of a JSON object. Example:
{
"codeReference": "00001",
"description": "Movimiento entrada",
"locationId": 1,
"productId": 1,
"quantity": 10,
"serialNum": null,
"thirdId": "ABC1",
"typeMovement": 1,
"unitValue": 2000,
"workOrderId": 0
}
Answer:
As an answer, a JSON object is obtained, with the following information:
{
"codeReference": "00001",
"description": "Movimiento entrada",
"locationId": 1,
"productId": 1,
"quantity": 10,
"serialNum": null,
"thirdId": "ABC1",
"typeMovement": 1,
"uniqueCode": 1,
"unitValue": 2000,
"workOrderId": 0
}
Error messages:
| Code | HTTP status | Error Message |
|---|---|---|
| 400 | BadRequest | Quantity is required. |
| 400 | BadRequest | SerialMum is required. |
| 400 | BadRequest | Quantity must be 1. |
| 400 | BadRequest | ProductId is inactive. |
| 400 | BadRequest | ProductId not found. |
| 400 | BadRequest | LocationId not found. |
| 400 | BadRequest | WorkOrder not found. |
| 400 | BadRequest | Product not found in Location. |
| 400 | BadRequest | No information found. |
| 500 | Internal Server Error | FailureLogin |