Event schemas

This page describes the JSON schemas for webhook events that are available relating to orders, phlebotomy and tests.

Order

{
  "eventType": "ORDER.CREATED",
  "version": "1",
  "email": "[email protected]",
  "orderNumber": "XXXX",
  "productCode": "XXXX",
  "shippingAddress": "1st line of address with city, country and postal code"
}
{
  "eventType": "ORDER.DISPATCHED",
  "version": "1",
  "email": "[email protected]",
  "orderNumber": "XXXX",
  "productCode": "XXXX",
  "dispatchedAt": "2022-03-07T16:13:42.345Z",
  "trackingUrl": "https://example.com?trackingId=<unique parcel reference>",
  "kits": [{
    "kitId": "KKKK0000"
  }]
}
{
  "eventType": "ORDER.OUT_FOR_DELIVERY",
  "version": "1",
  "email": "[email protected]",
  "orderNumber": "XXXX",
  "productCode": "XXXX",
  "outForDeliveryAt": "2022-03-07T16:13:42.345Z",
  "carrier": "ROYAL_MAIL",
  "trackingCode": "YJ993085875GB",
  "trackingUrl": "https://example.com?trackingId=<unique parcel reference>",
  "kits": [{
    "kitId": "KKKK0000"
  }]
}
{
  "eventType": "ORDER.RECEIVED",
  "version": "1",
  "email": "[email protected]",
  "orderNumber": "XXXX",
  "productCode": "XXXX",
  "receivedAt": "2022-03-07T16:13:42.345Z",
  "carrier": "ROYAL_MAIL",
  "trackingCode": "YJ993085875GB",
  "trackingUrl": "https://example.com?trackingId=<unique parcel reference>",
  "kits": [{
    "kitId": "KKKK0000"
  }]
}
{
  "eventType": "ORDER.RETURN_OUT_FOR_DELIVERY",
  "version": "1",
  "email": "[email protected]",
  "orderNumber": "XXXX",
  "productCode": "XXXX",
  "receivedAt": "2022-03-07T16:13:42.345Z",
  "carrier": "ROYAL_MAIL",
  "trackingCode": "YJ993085875GB",
  "trackingUrl": "https://example.com?trackingId=<unique parcel reference>",
  "kits": [{
    "kitId": "KKKK0000"
  }]
}
{
  "eventType": "ORDER.RETURN_RECEIVED",
  "version": "1",
  "email": "[email protected]",
  "orderNumber": "XXXX",
  "productCode": "XXXX",
  "receivedAt": "2022-03-07T16:13:42.345Z",
  "carrier": "ROYAL_MAIL",
  "trackingCode": "YJ993085875GB",
  "trackingUrl": "https://example.com?trackingId=<unique parcel reference>",
  "kits": [{
    "kitId": "KKKK0000"
  }]
}

Phlebotomy

Please note the NURSE_ASSIGNED event is only applicable to MOBILE phlebotomy.

{
  "eventType": "PHLEBOTOMY.NURSE_ASSIGNED",
  "version": "1",
  "orderNumber": "XXXX",
  "productCode": "XXXX",
  "kitId": "KKKK0000",
  "partnerUserId": "XXXX",
  "type": "MOBILE"
}
{
  "eventType": "PHLEBOTOMY.APPOINTMENT_SCHEDULED",
  "version": "1",
  "orderNumber": "XXXX",
  "productCode": "XXXX",
  "kitId": "KKKK0000",
  "partnerUserId" : "XXXX",
  "type": "MOBILE/IN-CLINIC",
  "clinicName": "My Phlebotomy Clinic", // For in-clinic only, null if mobile phlebotomy
  "clinicAddress": "8 Lombard Road, London", // For in-clinic only, null if mobile phlebotomy
  "clinicPostcode": "SW19 3TZ", // For in-clinic only, null if mobile phlebotomy
  "scheduledDate": "2022-03-07T16:13:42.345Z"
}
{
  "eventType": "PHLEBOTOMY.APPOINTMENT_RESCHEDULED",
  "version": "1",
  "orderNumber": "XXXX",
  "productCode": "XXXX",
  "kitId": "KKKK0000",
  "partnerUserId" : "XXXX",
  "type": "MOBILE/IN-CLINIC",
  "clinicName": "My Phlebotomy Clinic", // For in-clinic only, null if mobile phlebotomy
  "clinicAddress": "8 Lombard Road, London", // For in-clinic only, null if mobile phlebotomy
  "clinicPostcode": "SW19 3TZ", // For in-clinic only, null if mobile phlebotomy
  "scheduledDate": "2022-03-07T16:13:42.345Z"
}
{
  "eventType": "PHLEBOTOMY.APPOINTMENT_CANCELLED",
  "kitId": "FRXXX",
  "orderNumber": "XXXX",
  "partnerUserId" : "XXXX",
  "productCode": "XXXX",
  "type": "MOBILE/IN-CLINIC",
  "version": "1"
}

Test

{
  "eventType": "TEST.REGISTERED",
  "version": "1",
  "orderNumber": "XXXX",
  "productCode": "XXXX",
  "kitId": "KKKK0000",
  "partnerUserId": "620ce889de8cf1cbe9c370e11",
  "email": "[email protected]",
  "firstName": "John",
  "testTitle": "Example test"
}
{
  "eventType": "TEST.LAB_ACCESSIONED",
  "version": "1",
  "orderNumber": "XXXX",
  "productCode": "XXXX",
  "kitId": "KKKK0000",
  "partnerUserId": "620ce889de8cf1cbe9c370e11",
  "testId": "620ce889de8cf1cbe9c370e11"
}
{
  "eventType": "TEST.PROCESSED",
  "version": "1",
  "orderNumber": "XXXX",
  "productCode": "XXXX",
  "kitId": "KKKK0000",
  "partnerUserId": "620ce889de8cf1cbe9c370e11",
  "testId": "620ce889de8cf1cbe9c370e11"
}
{
  "eventType": "TEST.CLINICAL_COMMENTARY_UPLOADED",
  "version": "1",
  "orderNumber": "XXXX",
  "productCode": "XXXX",
  "kitId": "KKKK0000",
  "partnerUserId" : "XXXX",
  "testId": "620ce889de8cf1cbe9c370e11"
}