Materiais
A rota /api/integration/materials permite enviar materiais para o Smarti Supply.
Method: POST
Essa rota aceita solicitações POST para Smarti Supply.
Headers
| Header | Value | Required | Description |
|---|---|---|---|
Content-Type | application/json | Yes | The content type of the request body. |
Authorization | Bearer [access_token] | Yes | The authorization header. |
X-Api-Key | xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx | Yes | The key to verify the message integrity. |
Request
O corpo da solicitação será um objeto JSON com a seguinte estrutura:
Parameters
| Name | Type | Description | Required |
|---|---|---|---|
| metadata | objeto | O objeto de metadados. | No |
| metadata.page_total_count | int | O número total de páginas. | No |
| metadata.total_records | int | O número total de registros. | No |
| metadata.page_records | int | O número de registros por página. | No |
| metadata.page_number | int | O número da página atual. | No |
| metadata.batch_id | string | O ID do lote. | No |
| items | array | O array de itens. | Yes |
| items[].id | string | O ID do material. | Yes |
| items[].merchandise_group | string | O grupo de mercadoria. | Yes |
| items[].mesurement_unit | string | A unidade de medida. | Yes |
| items[].min_size | int | O tamanho mínimo da remessa. | No |
| items[].max_size | int | O tamanho máximo da remessa. | No |
| items[].fixed_size | int | O tamanho fixo da remessa. | No |
| items[].rounding | string | A arredondamento da remessa. (+/-) | No |
| items[].lead_time | int | O tempo de lead em dias. | Yes |
| items[].organization_stock[] | array | O array de estoques. | No |
| items[].organization_stock[].code | int | O código da organização(Filial/Depósito/Armazém). | Yes |
| items[].organization_stock[].quantity | int | A quantidade de estoque. | Yes |
| items[].organization_stock[].restricted_stock | boolean:default:false | Se o estoque é restrito. | No |
| items[].organization_stock[].blocked_stock | boolean:default:false | Se o estoque é bloqueado. | No |
Example
{ "metadata": { "page_total_count": "2", "total_records": "1791", "page_records": "1000", "page_number": "1", "batch_id": "20240301-0001" }, "items":[ { "id": "000000000000100018", "merchandise_group": "001.0.001", "mesurement_unit": "KG", "min_size": 25000000, "max_size": 0, "fixed_size": 0, "lead_time": 31, "rounding": "+", "organization_stock": [ { "code": "EI03", "quantity": 2792936000, "restricted_stock": false, "blocked_stock": false } ]
} ]
}Responses
| Code | Description |
|---|---|
| 200 | Order created |
| 400 | Invalid input |
| 500 | Internal server error |
200
{ "message": "Batch of orders received"}400
{ "error": { "message": "Invalid input" }}