Skip to content

Criação de Inventário via API POST

O endpoint abaixo permite, através de um POST HTTP, criar inventários.

Exemplo em cURL

shell
curl 'http://SERVER:PORT/api/inventory/save' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic aW50ZWdyYcOnw6NvOjEyMzQ1Njc4' \
-d '{
    "description": "Inventário 1",
    "status": "PENDING",
    "date": "2024-10-02",
    "placeReferences": [
        "Local 1",
        "Local 2",
        "Local 3"
    ],
    "invoiceReferences": [
        "Inv"
    ],
    "skuReferences": [
        "201"
    ]
}'

Obs 1: SERVER é o IP ou DNS do servidor onde o sistema Valesoft está instalado e PORT é a porta definida na instalação.

Obs 2: A chamada para esse endpoint necessita autenticação do tipo Basic com credenciais de um usuário devidamente cadastrado no sistema Valesoft. Ex: Usuário integração com senha 12345678 => Authorization: Basic aW50ZWdyYcOnw6NvOjEyMzQ1Njc4

Definições dos campos do corpo da requisição:

  • description - OBRIGATÓRIO

    • Descrição do inventário
  • status - OBRIGATÓRIO

    • Status do inventário
    • Valores aceitos:
      • PENDING - Pendente
      • DONE - Concluído
  • date - OBRIGATÓRIO

    • Data no formato AAAA-MM-DD
    • Ex 2023-11-01
  • placeReferences

    • Lista de referências dos locais
  • invoiceReferences

    • Lista de referências dos documentos
  • skuReferences

    • Lista de referências dos skus dos produtos

Resposta em caso de sucesso

Retorna um JSON do inventário criado:

JSON
{
    "id": "44c180fb-6f3b-4578-b0b1-a3d09d5c35fe",
    "createdAt": "2024-10-02 10:04:34.605",
    "createdBy": "valesoft",
    "updatedAt": "2024-10-02 10:04:34.605",
    "updatedBy": "valesoft",
    "custom": null,
    "integrated": false,
    "description": "Inventário 1",
    "status": "PENDING",
    "date": "2024-10-02",
    "invoiceList": [
        {
            "id": "fe5974d2-ea5f-47d6-bd58-c8b8472622ea",
            "createdAt": "2024-09-25 14:04:43.590",
            "createdBy": "valesoft",
            "updatedAt": "2024-09-25 14:04:43.590",
            "updatedBy": "valesoft",
            "custom": null,
            "integrated": false,
            "reference": "Inv",
            "description": "Inv",
            "supplier": null,
            "cloudClient": null,
            "customer": null,
            "place": null,
            "flow": null,
            "externalId": null,
            "type": "SHIPPING",
            "date": "2024-09-25",
            "batch": null,
            "label": null,
            "approvalStatus": "CREATED",
            "hasReserve": false,
            "printStatus": null,
            "costCenter": null,
            "nextWorkflow": null
        }
    ],
    "placeList": [
        {
            "id": "c5445c7c-1bf9-4bcb-8ed2-e178165f6c2e",
            "createdAt": "2024-08-21 15:56:10.214",
            "createdBy": "valesoft",
            "updatedAt": "2024-08-21 15:56:10.214",
            "updatedBy": "valesoft",
            "custom": null,
            "integrated": false,
            "reference": "Local 1",
            "name": "Local 1",
            "address": null,
            "localization": null,
            "latitude": null,
            "longitude": null,
            "externalId": null,
            "parent": null,
            "type": "SECTOR"
        },
        {
            "id": "05f82851-a8cb-4b6e-92a7-eb910fe2e8f4",
            "createdAt": "2024-09-23 08:54:02.670",
            "createdBy": "valesoft",
            "updatedAt": "2024-09-23 08:54:02.670",
            "updatedBy": "valesoft",
            "custom": null,
            "integrated": false,
            "reference": "Local 3",
            "name": "Local 3",
            "address": null,
            "localization": null,
            "latitude": null,
            "longitude": null,
            "externalId": null,
            "parent": null,
            "type": "SECTOR"
        },
        {
            "id": "210c2c71-a9ad-466d-a1f3-e7fe9c2a8575",
            "createdAt": "2024-09-23 08:53:54.806",
            "createdBy": "valesoft",
            "updatedAt": "2024-09-23 08:53:54.806",
            "updatedBy": "valesoft",
            "custom": null,
            "integrated": false,
            "reference": "Local 2",
            "name": "Local 2",
            "address": null,
            "localization": null,
            "latitude": null,
            "longitude": null,
            "externalId": null,
            "parent": null,
            "type": "SECTOR"
        }
    ],
    "productReferenceList": [
        {
            "id": "7e70d5c4-d71f-4121-b36d-a591fa330951",
            "createdAt": "2025-02-14 08:56:06.780",
            "createdBy": "valesoft",
            "updatedAt": "2025-02-14 08:56:06.780",
            "updatedBy": "valesoft",
            "product": {
                "id": "1420c42c-b6c8-4345-bae3-96edffeded26",
                "createdAt": "2025-02-14 08:56:06.699",
                "createdBy": "valesoft",
                "updatedAt": "2025-02-14 08:56:06.699",
                "updatedBy": "valesoft",
                "custom": {
                    "isflorisa": false,
                    "integrated": false
                },
                "integrated": false,
                "sku": "201",
                "description": "201",
                "barcode": null,
                "measureUnit": null,
                "fraction": null,
                "type": "RAW",
                "place": null,
                "averageCost": null,
                "externalId": null,
                "color": null,
                "size": null,
                "costCenter": null
            },
            "productGrid": null,
            "sku": "201",
            "description": "201 - 201",
            "color": null,
            "size": null,
            "measureUnit": null,
            "barcode": null,
            "fraction": null,
            "type": "RAW"
        }
    ]
}

Valesoft Sistemas RFID