Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This API is used to edit the details of an existing order including the list of specimens to be distributed. Please note, this API can be invoked only when the order is in pending or draft mode. At present, distributed orders cannot be edited.


URL/openspecimen/rest/ng/distribution-orders/{orderId}/
MethodPUT
Body


Code Block
{
  "name": "Test Order",
  "distributionProtocol": {
    "shortTitle": "Test DP"
  },
  "requester": { /* either one of the following needs to be specified */
    "id": 3,
    "loginName": "johnd",
    "emailAddress": "johnd@openspecimen.org"
  },
  "siteName": "North Hospital Labs",
  "distributor": {
    "id": 4,
    "loginName": "jannied",
    "emailAddress": "jannied@openspecimen.org"
  },
  "trackingUrl": "https://bluedart.com/openspecimen-orders/1/status",
  "comments": "Free text allowing users to add order notes",
  "status": "EXECUTED",
  "executionDate": 1526267841368,
  "specimenList": { /* Optional. If specified, allReservedSpmns and orderItems are ignored */
    "id": 7
  },
  "allReservedSpmns": true, /* Optional. If set to true, orderItems is ignored */
  "orderItems": [ /* Considered only when specimenList and allReservedSpmns are not set */
    {
      "specimen": { /* Specify either ID or (cpShortTitle, label) combination */
        "id": 701,
        "cpShortTitle": "Lung Cancer",
        "label": "LC-0001-V1-P1"
      },
      "quantity": 2,
      "cost": 2.5,
      "status": "DISTRIBUTED_AND_CLOSED"
    },
 
    /* Other specimens in the order */
  ] 
}


...

The path variable orderId should be set to the unique ID of the order to be updated. The unique ID is returned in create and query API responses.

Response


HTTP Status Code
Description
200The order is updated. The response body contains the updated order details.
400Something incorrect with the request. The response body contains the error code and the human readable error message.
500Something wrong with the server. Please contact support along with the request payload and exception stack trace.


...