> ## Documentation Index
> Fetch the complete documentation index at: https://developer.orchestro.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Scan events

> This endpoint captures event scan details for parcels as they move through the network.



## OpenAPI

````yaml analytics.json post /shipment-events
openapi: 3.0.1
info:
  title: Shipment API
  description: >
    The Shipments API captures details of parcels as they move across the
    network.
  version: 1.0.0
servers:
  - url: https://api-stage.orchestro.ai/e1/
    description: Sandbox Environment
  - url: https://api.orchestro.ai/
    description: Production Environment
security: []
paths:
  /shipment-events:
    post:
      tags:
        - Analytics
      summary: Scan events
      description: >-
        This endpoint captures event scan details for parcels as they move
        through the network.
      operationId: createShipmentEvent
      parameters:
        - in: header
          name: Content-Type
          required: true
          schema:
            type: string
            example: application/json
        - in: header
          name: Authorization
          required: true
          schema:
            type: string
            example: Bearer token
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - trackingId
                - accountNumber
                - carrierCode
                - event
              properties:
                trackingId:
                  type: string
                  maxLength: 25
                  description: Unique barcode attached to the parcel.
                accountNumber:
                  type: string
                  maxLength: 25
                  description: Orchestro-provided account number.
                carrierCode:
                  type: string
                  maxLength: 25
                  description: Code identifying the carrier.
                carrierName:
                  type: string
                  maxLength: 100
                  description: Full name of the carrier service.
                event:
                  type: object
                  required:
                    - latitude
                    - longitude
                  description: >-
                    Details of the shipment event, including timestamps,
                    location, and signature data.
                  properties:
                    comments:
                      type: string
                      maxLength: 200
                      description: Additional comments on the event, if any.
                    status:
                      type: string
                      maxLength: 25
                      description: Carrier event code. **Required.**
                    alternateStatusCode:
                      type: string
                      maxLength: 25
                      description: Alternative code for the status, if applicable.
                    deliverySignature:
                      type: string
                      maxLength: 200
                      description: Signature confirming delivery receipt.
                    timestamp:
                      type: string
                      format: date-time
                      description: ISO8601 timestamp for when the event occurred.
                    timezone:
                      type: string
                      maxLength: 3
                      description: Timezone of the event, e.g., CST, EST.
                    latitude:
                      type: number
                      format: double
                      description: Latitude coordinates for the event location.
                    longitude:
                      type: number
                      format: double
                      description: Longitude coordinates for the event location.
                    city:
                      type: string
                      maxLength: 50
                      description: City where the event was recorded.
                    state:
                      type: string
                      maxLength: 2
                      description: Two-letter state code (e.g., CA for California).
                    zip:
                      type: string
                      maxLength: 20
                      description: Zip or postal code for the event location.
                    pod:
                      type: object
                      description: Proof of delivery (POD) details.
                      properties:
                        otherDeliveryInfo:
                          type: string
                          maxLength: 200
                          description: Additional notes or details about the delivery.
                        signatureName:
                          type: string
                          maxLength: 200
                          description: Name associated with the delivery signature.
                        images:
                          type: array
                          items:
                            type: object
                            required:
                              - imageType
                              - imageUrl
                            description: Image object associated with the delivery.
                            properties:
                              imageType:
                                type: string
                                maxLength: 10
                                description: 'Type of image: POD or SIGNATURE.'
                              imageUrl:
                                type: string
                                maxLength: 2000
                                description: URL to access the image file.
                              expiration:
                                type: string
                                format: date
                                description: Date when the image expires, if applicable.
                phyAttributesUpdate:
                  type: object
                  description: >-
                    Physical attribute updates (e.g., length, width) for the
                    parcel.
                  properties:
                    updates:
                      type: array
                      items:
                        type: object
                        required:
                          - attribute
                          - newValue
                          - unit
                        properties:
                          attribute:
                            type: string
                            maxLength: 10
                            description: >-
                              The attribute being updated, e.g., length, width,
                              height.
                          newValue:
                            type: number
                            description: Updated measurement value.
                          unit:
                            type: string
                            maxLength: 4
                            description: >-
                              Unit of measurement, typically in inches or
                              pounds.
            examples:
              example1:
                summary: Pickup Event Example
                value:
                  trackingId: TEST-123
                  accountNumber: TEST_ACCOUNT_1
                  carrierCode: TEST_CARRIER_CODE
                  carrierName: TEST_CARRIER_NAME
                  event:
                    comments: Pickup scan successful
                    status: DPCK
                    alternateStatusCode: ''
                    deliverySignature: ''
                    timestamp: '2014-10-29T06:34:00'
                    timezone: CST
                    latitude: 38.896765
                    longitude: -77.036211
                    city: HARKER HEIGHTS
                    state: TX
                    zip: '76548'
                    pod: null
              example2:
                summary: Delivery Event with POD Example
                value:
                  trackingId: TEST-123
                  accountNumber: TEST_ACCOUNT_1
                  carrierCode: TEST_CARRIER_CODE
                  carrierName: TEST_CARRIER_NAME
                  event:
                    comments: Delivered at reception
                    status: DDEL
                    alternateStatusCode: ''
                    deliverySignature: 'Yes'
                    timestamp: '2024-03-18T07:30:00-06:04'
                    timezone: EST
                    latitude: 0
                    longitude: 0
                    city: Harwood Heights
                    state: IL
                    zip: '60706'
                    pod:
                      otherDeliveryInfo: ''
                      signatureName: Palanivel M
                      images:
                        - imageType: POD
                          imageUrl: >-
                            https://geodis.com/sites/default/files/2022-01/Adobe%20Stock_11322_1920x1080.jpg
                          expiration: '2024-03-17T07:30:00-06:04'
                        - imageType: SIGNATURE
                          imageUrl: >-
                            https://philadelphiamailroom.com/wp-content/uploads/2018/12/Woman-signing-receipt-of-delivery-300x199.jpg
                          expiration: '2024-03-17T07:30:00-06:04'
              example3:
                summary: Attribute Update Example
                value:
                  trackingId: TEST-123
                  accountNumber: TEST_ACCOUNT_1
                  carrierCode: TEST_CARRIER_CODE
                  carrierName: TEST_CARRIER_NAME
                  phyAttributesUpdate:
                    updates:
                      - attribute: length
                        newValue: 12.5
                        unit: lb
      responses:
        '200':
          description: Shipment event created successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: SUCCESS
        '400':
          description: Invalid request payload.
          content:
            application/json:
              example:
                errors:
                  - code: ERR-2072
                    message: The Account Number is invalid.
        '401':
          description: Unauthorized request due to invalid token.
          content:
            application/json:
              example:
                errors:
                  - code: ERR-1000
                    message: Invalid Token.
        '500':
          description: Internal Server Error.
          content:
            application/json:
              example:
                errors:
                  - code: ERR-2025
                    message: We are having some issue, please resubmit the request.
      security:
        - BearerAuth: []
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````