API ReferenceapiclinicalPOST /v1/lab-orders

POST /v1/lab-orders

Service: clinical · operationId: (none)

Create a Junction lab panel order for a patient

Required scopes

(no scope declared — review service config)

Required headers

  • idempotency-key

Request body

{
  "type": "object",
  "properties": {
    "brand_id": {
      "type": "string",
      "minLength": 1
    },
    "patient_id": {
      "type": "string",
      "format": "uuid"
    },
    "panel_id": {
      "type": "string",
      "enum": [
        "hashimotos",
        "pcos",
        "fertility"
      ]
    },
    "patient": {
      "type": "object",
      "properties": {
        "first_name": {
          "type": "string",
          "minLength": 1
        },
        "last_name": {
          "type": "string",
          "minLength": 1
        },
        "dob": {
          "type": "string",
          "minLength": 1
        },
        "email": {
          "type": "string",
          "format": "email"
        }
      },
      "required": [
        "first_name",
        "last_name",
        "dob",
        "email"
      ]
    },
    "address": {
      "type": "object",
      "properties": {
        "line1": {
          "type": "string",
          "minLength": 1
        },
        "line2": {
          "type": "string",
          "minLength": 1
        },
        "city": {
          "type": "string",
          "minLength": 1
        },
        "state": {
          "type": "string",
          "minLength": 1
        },
        "zip": {
          "type": "string",
          "minLength": 1
        },
        "country": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "line1",
        "city",
        "state",
        "zip",
        "country"
      ]
    }
  },
  "required": [
    "brand_id",
    "patient_id",
    "panel_id"
  ]
}

Responses

201 Lab order created

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "brand_id": {
      "type": "string"
    },
    "patient_id": {
      "type": "string",
      "format": "uuid"
    },
    "junction_order_id": {
      "type": "string"
    },
    "panel_id": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "completed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  },
  "required": [
    "id",
    "brand_id",
    "patient_id",
    "junction_order_id",
    "panel_id",
    "status",
    "created_at",
    "completed_at"
  ]
}

400 Validation error

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

409 Idempotency key conflict

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

502 Junction API error

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

Example

curl -X POST https://clinical.platform.loop.health/v1/lab-orders \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'