# Send Delivery Updates

Sends information about the delivery in progress.
**This endpoint should be used when the delivery is the responsibility of the Merchant, so the Software Service should send the delivery updates to the Ordering Application.**
HOST: **Keeta**
DIRECTION:

Endpoint: POST /v1/orders/{orderId}/tracking
Version: v.1.0.7
Security: OAuth2, Sig

## Security:

  - `OAuth2` (unknown)
    oauth2 scopes: od.all

  - `Sig` (unknown)
    apiKey in header X-App-Signature

## Path parameters:

  - `orderId` (string, required)

## Request fields (application/json):

  - `deliveryTrackingInfo` (object, required)
    Information about the person that was assigned to deliver the order.

  - `deliveryTrackingInfo.event` (object)
    The delivery last known event.

  - `deliveryTrackingInfo.event.type` (string, required)
    The current delivery event.
    Enum: "PICKUP_ONGOING", "ARRIVED_AT_MERCHANT", "ORDER_PICKED", "DELIVERY_ONGOING", "ARRIVED_AT_CUSTOMER", "ORDER_DELIVERED", "CANCELLED"

  - `deliveryTrackingInfo.event.message` (string)
    Free message. It should be used to provide more detailed information.

  - `deliveryTrackingInfo.event.datetime` (string, required)
    Date and time when the event ocurred.
(UTC date-time in ISO timestamp format. See [Guidelines](#section/General-Guidelines) for more info).

  - `deliveryTrackingInfo.problem` (object)
    In the event of a delivery problem, it states the last known reason.

  - `deliveryTrackingInfo.problem.reason` (string, required)
    Problem reason.
    Enum: "DELIVERYPERSON_OCCURRENCE", "PAYMENT_PROBLEMS", "WRONG_PRODUCT_OR_ITEM", "ORDER_DELAYED", "ORDER_DAMAGED_OR_VIOLATED", "CUSTOMER_DID_NOT_PLACE_ORDER", "CUSTOMER_ADDRESS_UNKNOWN", "ORDER_MISSING_ITEMS", "NOBODY_TO_RECEIVE", "DELIVERYPERSON_WAITING_PAYMENT_FOR_ALREADY_PAID_ORDER", "ORDER_DELIVERED_WITHOUT_PAYMENT", "FRAUD_OR_THEFT"

  - `deliveryTrackingInfo.problem.message` (string)
    Free message. It should be used to provide more detailed information.

  - `deliveryTrackingInfo.problem.datetime` (string, required)
    Date and time when the problem ocurred.
(UTC date-time in ISO timestamp format. See [Guidelines](#section/General-Guidelines) for more info).

  - `deliveryTrackingInfo.vehicle` (object)
    The vehicle that will be used for this delivery.

  - `deliveryTrackingInfo.vehicle.type` (array, required)
    Vehicle Type

  - `deliveryTrackingInfo.vehicle.licencePlate` (string)
    Licence plate of the vehicle user for the delivery.

  - `deliveryTrackingInfo.eta` (object)
    Estimate Times of Pickup and Delivery.

  - `deliveryTrackingInfo.eta.pickupEtaInMinutes` (integer)
    Pickup Eta in **minutes**. Informs how many minutes it will take the delivery person to arrive at the merchant for order pickup.

  - `deliveryTrackingInfo.eta.pickupEtaDatetime` (string)
    Pickup Eta Datetime. Informs the date and time the delivery person is expected to arrive at the merchant for order pickup.
(UTC date-time in ISO timestamp format. See [Guidelines](#section/General-Guidelines) for more info).

  - `deliveryTrackingInfo.eta.deliveryEtaInMinutes` (integer)
    Delivery Eta in **minutes**. Informs how many minutes it will take the delivery person to arrive at the consumer's address for order delivery.

  - `deliveryTrackingInfo.eta.deliveryEtaDatetime` (string)
    Delivery Eta Datetime. Informs the date and time the delivery person is expected to arrive at the consumer's address for order delivery.
(UTC date-time in ISO timestamp format. See [Guidelines](#section/General-Guidelines) for more info).

  - `deliveryTrackingInfo.eta.maxDeliveryTime` (string)
    Maximum Date and Time for delivery. This time should not exceed the delivery time limit given in the order request.
(UTC date-time in ISO timestamp format. See [Guidelines](#section/General-Guidelines) for more info).

  - `deliveryTrackingInfo.deliveryPerson` (object)
    Information about the person taht was assigned to deliver the order.

  - `deliveryTrackingInfo.deliveryPerson.id` (string)
    Delivery Person Id given by the `Keeta`.

  - `deliveryTrackingInfo.deliveryPerson.name` (string)
    Delivery Person Name.

  - `deliveryTrackingInfo.deliveryPerson.pictureURL` (string)
    URL to access the photo of the delivery person. Before entering this field, check that the parties allow data to be shared according to data disclosure laws and rules.

  - `deliveryTrackingInfo.geoLocalization` (object)
    Geo Localization Info.

  - `deliveryTrackingInfo.geoLocalization.latitude` (number)
    Indicates the latitude coordinate of the actual position of the delivery person.
Latitude in degrees. Values are restricted to the range [[-90, 90]].
    Example: -23.54809

  - `deliveryTrackingInfo.geoLocalization.longitude` (number)
    Indicates the longitude coordinate of the actual position of the delivery person.
Longitude in degrees. Values are restricted to the range [[-180, 180]].
    Example: -46.63638

  - `deliveryTrackingInfo.geoLocalization.lastAddress` (object)
    The last known address that the delivery person was when the event was sent.

  - `deliveryTrackingInfo.geoLocalization.lastAddress.country` (string)
    Two-letter [ISO 3166-1 alpha-2](https://www.iso.org/standard/72482.html) country code.
    Example: BR

  - `deliveryTrackingInfo.geoLocalization.lastAddress.state` (string)
    State or country subdivision. It is recommended (but not required) that you use the [ISO 3166-2](https://www.iso.org/standard/72483.html) representation.
    Example: BR-SP

  - `deliveryTrackingInfo.geoLocalization.lastAddress.city` (string)
    City name.
    Example: São Paulo

  - `deliveryTrackingInfo.geoLocalization.lastAddress.district` (string)
    District or Neighborhood name.
    Example: Moema

  - `deliveryTrackingInfo.geoLocalization.lastAddress.street` (string)
    Street Name.
    Example: Plaza Avenue

  - `deliveryTrackingInfo.geoLocalization.lastAddress.postalCode` (string)
    Postal Code.
    Example: 20111-000

  - `deliveryTrackingInfo.geoLocalization.lastAddress.distanceToPickup` (string, required)
    Distance To Pickup in **meters**.

  - `deliveryTrackingInfo.geoLocalization.lastAddress.distanceToDelivery` (string, required)
    Distance To Delivery in **meters**.

  - `deliveryTrackingInfo.geoLocalization.lastAddress.timestamp` (string, required)
    Date and time when this information is valid.
(UTC date-time in ISO timestamp format. See [Guidelines](#section/General-Guidelines) for more info).

  - `deliveryTrackingInfo.externalTrackingURL` (string)
    External URL, provided by the logistics service to track the delivery on a specific page. Example: Real-time map view, or delivery timeline.

## Response 202:

  - `202` (unknown)
    Request has been accepted for processing.

## Response 400:

  - `400` (unknown)
    Bad Request

## Response 400 fields (application/problem+json):

  - `title` (string, required)
    Short description of the problem.
    Example: Unexpected error

  - `status` (integer, required)
    HTTP code of the returned status.
    Example: 500

## Response 401:

  - `401` (unknown)
    Request lacks valid authentication credentials for the target resource

## Response 401 fields (application/problem+json):

  - `title` (string, required)
    Short description of the problem.
    Example: Unexpected error

  - `status` (integer, required)
    HTTP code of the returned status.
    Example: 500

## Response 403:

  - `403` (unknown)
    Authenticated participant request that violates some authorization rule.

## Response 403 fields (application/problem+json):

  - `title` (string, required)
    Short description of the problem.
    Example: Unexpected error

  - `status` (integer, required)
    HTTP code of the returned status.
    Example: 500

## Response 404:

  - `404` (unknown)
    The requested resource was not found.

## Response 404 fields (application/problem+json):

  - `title` (string, required)
    Short description of the problem.
    Example: Unexpected error

  - `status` (integer, required)
    HTTP code of the returned status.
    Example: 500

## Response 422:

  - `422` (unknown)
    Server understands the content type of the request entity, and the syntax of the request entity is correct, but it was unable to process the contained instructions. (Check if the instruction has not been sent before.)

## Response 422 fields (application/problem+json):

  - `title` (string, required)
    Short description of the problem.
    Example: Unexpected error

  - `status` (integer, required)
    HTTP code of the returned status.
    Example: 500

## Response 503:

  - `503` (unknown)
    Service is not currently available. Requested service may be under maintenance or outside the operating window.

## Response 503 fields (application/problem+json):

  - `title` (string, required)
    Short description of the problem.
    Example: Unexpected error

  - `status` (integer, required)
    HTTP code of the returned status.
    Example: 500

