Orders

Orders are a group of items that are picked or put into the storage system. When creating and updating orders, the changes need to be verified and updated asynchronously by PowerPick.

Attributes

  • id string

    Unique identifier for the object.

  • name string

    Non-unique name for the order.

  • status string

    Either pending, failed, queued, or processed. Pending is awaiting import, failed is not imported, queued is imported but not fully picked, and processed is fully picked.

  • priority integer

    Number priority for the order. Higher number indicates higher priority.

  • createdAt datetime

    The date/time this order was created.

  • deadline date

    When the order is due.

  • directionType integer

    1 if the order is a pick order, 2 if it is a put order.

  • handlingUnit string

    DEPRECATED.

  • warehouseName string

    Name of the warehouse this order belongs to.

  • errorCode integer

  • errorDescription string

  • info1 string

    A generic field for custom use.

  • info2 string

    A generic field for custom use.

  • info3 string

    A generic field for custom use.

  • info4 string

    A generic field for custom use.

  • info5 string

    A generic field for custom use.

  • zones array

    Array of Zone names this order is a part of.

  • number integer

    Non-unique name for the order line.

  • materialName string

  • quantityRequested float

    The quantity to be processed.

  • quantityConfirmed float

    The quantity that was confirmed on the order line. Only shows if the order line was processed.

  • quantityDeviated float

    The amount that was missing. Only shows if the order line was processed.

Endpoints

List Orders

get /api/orders

Arguments

  • limit integer

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

  • offset integer

    Will return items, but only those after the integer amount.

  • orderBy string, array

    Order the response by the selected field. Multiple values can be passed, separated by a comma.

  • countOnly boolean

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

  • status string

    Only return order with a certain status, either pending, failed, queued, or processed. Default is processed.

  • createdAfter datetime

    Only return orders that were created after a certain date.

  • createdBefore datetime

    Only return orders that were created before a certain date.

  • processedAfter datetime

    Only return orders that were processed (picked or put) after a certain date.

  • processedBefore datetime

    Only return orders that were processed (picked or put) before a certain date.

  • name string

    Only return orders that have the given name.

  • priority integer

    Only return orders that have the given priority.

  • handlingUnit string

  • directionType integer

    Only return orders that have the given direction type.

  • [dynamic_field]

    Any dynamic fields that have been set up can be used as a filter.

Request with curl
curl "http://[Your IP]/api/orders" \ -X get \-H "Content-Type: application/json" \-H "Authorization: Bearer [Your JWT Access Token]"
Example Response
{ "orders": [{ "id": "AFAC0A52-4677-4D22-B92C-B7AFA3B76947", "name": "40243656", "status": "pending", "priority": "4", "createdAt": "2020-02-09 02:57:00.290", "deadline": "2020-02-10 00:36:00.113", "directionType": "1", "handlingUnit": "string", "warehouseName": "Warehouse 1", "errorCode": "integer", "errorDescription": "string", "info1": "string", "info2": "string", "info3": "string", "info4": "string", "info5": "string", "zones": "[]", "orderLines": [{ "number": "22", "materialName": "ITEM00241", "quantityRequested": "10", "quantityConfirmed": "8", "quantityDeviated": "2", }] }] }

Create Order

post /api/orders

Create an order and get a response.

Body Parameters

  • number string REQUIRED

    The order number.

  • priority integer

    Number priority for the order. Defaults to 2.

  • directionType integer

    1 if the order is a pick order, 2 if it is a put order. Defaults to 1.

  • deadline datetime

    When the order is due.

  • [DynamicField] string

    Any of the dynamic order fields from PowerPick.

  • orderLines array REQUIRED

    Any amount of order lines related to this order (see Order Line for more information on fields).

  • quantity integer REQUIRED

    The amount of material on the order line.

  • materialName string REQUIRED

    The name of the material on the order line.

  • number integer REQUIRED

    The line number of the order line. Must be sequential starting from 1.

Request with curl
curl "http://[Your IP]/api/orders" \ -X post \ -H "Content-Type: application/json" \-H "Authorization: Bearer [Your JWT Access Token]" \ -d '{ "number": "string", "order_lines": [{ "number": "string", "materialName": "string", "quantity": "integer" }] "quantity": "integer", "materialName": "string", "number": "integer", }'
Example Response
{ "order": { "id": "AFAC0A52-4677-4D22-B92C-B7AFA3B76947", "name": "40243656", "status": "pending", "priority": "4", "createdAt": "2020-02-09 02:57:00.290", "deadline": "2020-02-10 00:36:00.113", "directionType": "1", "handlingUnit": "string", "warehouseName": "Warehouse 1", "errorCode": "integer", "errorDescription": "string", "info1": "string", "info2": "string", "info3": "string", "info4": "string", "info5": "string", "zones": "[]", "orderLines": [{ "number": "22", "materialName": "ITEM00241", "quantityRequested": "10", "quantityConfirmed": "8", "quantityDeviated": "2", } }

Show Order

get /api/orders/[id]

Get a specific order from the PPG database and return a JSON response. The order will be pulled either from the MasterOrder table or the HistoryMasterOrder table, depending on whether it's been picked.

Request with curl
curl "http://[Your IP]/api/orders/[id]" \ -X get \-H "Content-Type: application/json" \ -H "Authorization: Bearer [Your JWT Access Token]"
Example Response
{ "order": { "id": "AFAC0A52-4677-4D22-B92C-B7AFA3B76947", "name": "40243656", "status": "pending", "priority": 4, "createdAt": 2020-02-09 02:57:00.290, "deadline": 2020-02-10 00:36:00.113, "directionType": 1, "handlingUnit": "string", "warehouseName": "Warehouse 1", "errorCode": integer, "errorDescription": "string", "info1": "string", "info2": "string", "info3": "string", "info4": "string", "info5": "string", "zones": [], "orderLines": [{ "number": 22, "materialName": "ITEM00241", "quantityRequested": 10, "quantityConfirmed": 8, "quantityDeviated": 2, } }

Update Order

put /orders/[id]

Update an order and get a response. Each key/value is optional. Only keys sent will be updated, but an object is required to be sent.

Arguments

  • handlingUnit string

  • number string

  • [DynamicField] string

Request with curl
curl "http://[Your IP]/orders/[id]" \ -X put \-H "Content-Type: application/json" \-H "Authorization: Bearer [Your JWT Access Token]"
Example Response
{ "order": { "id": "AFAC0A52-4677-4D22-B92C-B7AFA3B76947", "name": "40243656", "status": "pending", "priority": "4", "createdAt": "2020-02-09 02:57:00.290", "deadline": "2020-02-10 00:36:00.113", "directionType": "1", "handlingUnit": "string", "warehouseName": "Warehouse 1", "errorCode": "integer", "errorDescription": "string", "info1": "string", "info2": "string", "info3": "string", "info4": "string", "info5": "string", "zones": "[]", "orderLines": [{ "number": "22", "materialName": "ITEM00241", "quantityRequested": "10", "quantityConfirmed": "8", "quantityDeviated": "2", } }

Delete Order

get /api/orders/[id]/delete

Delete a specific order from the PPG database and return a JSON response. This will also delete the order lines associated with the order.

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