Kit Lines

A kit line contains one type of material or another kit within a kit.

Attributes

  • id uuid

    Unique identifier for the kit line.

  • number integer

    Unique line sequence number of the kit line. If none is provided, the system automatically generates this.

  • materialId uuid

    The ID of the material or kit on the kit line.

  • materialName string

    The name of the material or nested kit.

  • quantity float

    If a material, the quantity of materials.
    If a kit, the multiplier for the entire contents of the included kit.

  • hasStock integer

    If there is enough stock to fulfill the kit line.

    Possible values:

    0 = False
    1 = True

Endpoints

List Kit Lines

get /api/kit_lines

Arguments

  • number integer

    Unique line sequence number of the kit line. If none is provided, the system automatically generates this.

  • materialId uuid

    The ID of the material or kit on the kit line.

  • materialName string

    The name of the material or nested kit.

  • quantity float

    If a material, the quantity of materials.
    If a kit, the multiplier for the entire contents of the included kit.

  • hasStock integer

    If there is enough stock to fulfill the kit line.

    Possible values:

    0 = False
    1 = True

  • limit integer

    A limit on the number of objects to be returned. Limit can range between 1 and 1000.

    Default value: 250

  • page integer

    Page-numbering is based on the value of the "limit" argument. If limit=20, then page=0 will display the hits from 1 to 20. (Page numbers are zero-based.) Using page without a limit returns all items.

  • countOnly boolean

    When "true", will only return a count of the amount of items in the query.

    Default value: false

Request with curl
curl "http://[Your IP] /api/kit_lines" \ -X get \ -H "Content-Type: application/json" \ -H "Authorization: Bearer [Your JWT Access Token]"
Example Response
{ "kit_lines": [{ "id": " uuid ", "number": " integer ", "materialId": " uuid ", "materialName": " string ", "quantity": " float ", "hasStock": " integer ", }] }] }

Create Kit Line

post /api/kit_lines

Create a kit line, to be imported by PowerPick. Requires passing the ID of the kit the new line is being added to.

Body Parameters

  • kitId uuid
    REQUIRED

    The ID of the kit this kit line belongs to.

  • number integer

    Unique line sequence number of the kit line. If none is provided, the system automatically generates this.

  • materialId uuid
    REQUIRED

    The ID of the material or kit on the kit line.

  • quantity float

    If a material, the quantity of materials.
    If a kit, the multiplier for the entire contents of the included kit.

  • target string

Request with curl
curl "http://[Your IP] /api/kit_lines" \ -X post \ -H "Content-Type: application/json" \ -H "Authorization: Bearer [Your JWT Access Token]" \ -d '{ "kitId": "uuid", "materialId": "uuid", }'
Example Response
{ "kit_line": { "id": " uuid ", "number": " integer ", "materialId": " uuid ", "materialName": " string ", "quantity": " float ", "hasStock": " integer ", } }

Show Kit Line

get http://api/kit_lines/[id]

Get a specific kit line by its ID from the PPG database and return a JSON response.

Arguments

Request with curl
curl "http://[Your IP] http://api/kit_lines/[id]" \ -X get \ -H "Content-Type: application/json" \ -H "Authorization: Bearer [Your JWT Access Token]"
Example Response
{ "kit_line": { "id": uuid , "number": integer , "materialId": uuid , "materialName": " string " , "quantity": float , "hasStock": integer , } }

Update Kit Line

put /api/kit_lines/[id]

Update a kit line by calling its ID and get a response. Each key/value is optional. Only keys sent will be updated.

Arguments

  • kitId uuid

    The ID of the kit this kit line belongs to.

  • number integer

    Unique line sequence number of the kit line. If none is provided, the system automatically generates this.

  • materialId uuid

    The ID of the material or kit on the kit line.

  • quantity float

    If a material, the quantity of materials.
    If a kit, the multiplier for the entire contents of the included kit.

  • target string

Request with curl
curl "http://[Your IP] /api/kit_lines/[id]" \ -X put \ -H "Content-Type: application/json" \ -H "Authorization: Bearer [Your JWT Access Token]"
Example Response
{ "kit_line": { "id": " uuid ", "number": " integer ", "materialId": " uuid ", "materialName": " string ", "quantity": " float ", "hasStock": " integer ", } }

Delete Kit Line

delete http://api/kit_lines/[id]/delete

Delete a kit line by calling its ID.

Arguments

Request with curl
curl "http://[Your IP] http://api/kit_lines/[id]/delete" \ -X delete \ -H "Content-Type: application/json" \ -H "Authorization: Bearer [Your JWT Access Token]"
Example Response
{ "deleted": "true" }