EN
Español
English
Português
    Product Creation

    The related operation for the creation of inventory products is described.

    Details of the request:

    • Base URL: {host}/AFLSAPI/
    • URI: /api/inventory/product
    • 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/product
    


    Parameters:

    Name Data type Obligatory Description
    Cost number Yes Product Cost
    Description String Yes Product Description
    isActive Boolean Yes Product Condition
    measureId Integer Yes Measure Identifier
    minimuAmount Integer Yes Minimum available quantity of product, minimum 1
    Name String Yes Product Name
    sku String Yes Unique Product Code
    typeProduct Integer Yes Product Type (0 - Quantity, 1 - Unique Code)

    Body of the petition:

    The request consists of a JSON object. Example:

    {
      "cost": 1000,
      "description": "Cable 20",
      "isActive": true,
      "measureId": 1,
      "minimuAmount": 2,
      "name": "Cable Coaxial",
      "sku": "C001",
      "typeProduct": 0
    }
    

    Answer:

    As an answer, a JSON object is obtained, with the following information:

    {
      "cost": 1000,
      "description": "Cable 20",
      "id": 1
      "isActive": true,
      "measureId": 1,
      "minimuAmount": 2,
      "name": "Cable Coaxial",
      "sku": "C001",
      "typeProduct": 0
    }
    

    Error messages:

    Code HTTP status Error Message
    400 BadRequest MeasureId not found.
    400 BadRequest MeasureId is inactive.
    400 BadRequest Other product exist with the same name.
    400 BadRequest Other product exist with the same Sku.
    400 BadRequest No information found.
    500 Internal Server Error FailureLogin