Post courier session events

POST /app/courier/sessions/events

Post events related to a specific courier session. This endpoint is used to log and track events that occur during a courier's session.

application/json

Body Required

  • externalLockerId string Required

    The unique identifier assigned by the carrier to the locker.

  • parcelId string | null

    The unique identifier of the parcel. Nullable if not applicable.

  • timestamp string(date-time) Required

    The UTC timestamp of the event in the ISO 8601 format.

  • shipmentType string | null

    The type of shipment. Nullable if not applicable.

    Values are LAST_MILE, RETURN, or FIRST_MILE.

  • flowStatus string Required

    The status of the flow.

    Values are STARTED, IN_PROGRESS, PARCEL_SCANNED, or COMPLETED.

  • errors object | null

    Error details if any. Nullable if no errors.

    Hide errors attributes Show errors attributes object | null
    • errorLevel string | null

      The level at which the error occurred.

      Values are LOCKER or PARCEL.

    • errorCode string | null

      The code representing the type of error.

      Values are COMPARTMENT_BROKEN, ENTIRE_STATION_BROKEN, NO_ACCESS_TO_STATION, PACKET_IS_TOO_BIG_FOR_STATION, NO_SUITABLE_COMPARTMENT_AVAILABLE, COMPARTMENT_ALREADY_OCCUPIED, COMPARTMENT_IS_EMPTY, or PARCEL_NOT_AVAILABLE.

  • vehicleNo string | null

    The unique number assigned to the vehicle delivering/picking parcels.

  • depotNo string | null

    The unique number assigned to the depot.

  • carrier string Required

    The carrier identifier

  • provider string Required

    The provider identifier

Responses

  • 200 application/json

    Events posted successfully

    Hide response attribute Show response attribute object
  • 401 application/json

    Unauthorized. The request is missing valid authentication credentials.

    Hide response attribute Show response attribute object
    • error string

      Error message indicating lack of authorization

  • 400 application/json

    Bad Request. The request is malformed or missing required parameters.

    Hide response attribute Show response attribute object
    • error string

      Error message detailing the cause of the bad request

  • 500 application/json

    Internal Server Error. An unexpected error occurred on the server.

    Hide response attribute Show response attribute object
    • error string

      Error message indicating an internal server error

POST /app/courier/sessions/events
curl \
 --request POST 'https://api.staging.glsnxt.com/ooh/carrier-connector/v1/app/courier/sessions/events' \
 --header "X-APP-Key: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '[{"externalLockerId":"locker123","parcelId":"parcel123","timestamp":"2021-10-01T12:00:00Z","shipmentType":"LAST_MILE","flowStatus":"STARTED","errors":{"errorLevel":"LOCKER","errorCode":"COMPARTMENT_BROKEN"},"vehicleNo":"Vehicle01","depotNo":"Depot10","carrier":"GLS_DE","provider":"SWIPBOX"}]'
Request examples
[
  {
    "externalLockerId": "locker123",
    "parcelId": "parcel123",
    "timestamp": "2021-10-01T12:00:00Z",
    "shipmentType": "LAST_MILE",
    "flowStatus": "STARTED",
    "errors": {
      "errorLevel": "LOCKER",
      "errorCode": "COMPARTMENT_BROKEN"
    },
    "vehicleNo": "Vehicle01",
    "depotNo": "Depot10",
    "carrier": "GLS_DE",
    "provider": "SWIPBOX"
  }
]
Response examples (200)
{
  "status": "Events have been published successfully"
}
Response examples (401)
{
  "error": "Unauthorized"
}
Response examples (400)
{
  "error": "Invalid request. Check parameters and try again."
}
Response examples (500)
{
  "error": "Internal Server Error"
}