Three lines

Uber

Developers

Order Receipt Notification

WEBHOOK: POSThttps://<YOUR_WEBHOOK_URI> event_type: business_order.receipt

Event indicating that a receipt has been created for the trip. Sent upon completion of a trip or update to the final fare of a trip taken on the organization’s profile.

Retry Attempts

If for some reason the Uber API cannot reach the webhook URL you specified either due to networking issues or application issues on your end, the webhooks service will retry to make a request.

We have implemented an exponential back-off algorithm with a back-off multiplier of 30 seconds which will make up to 7 attempts. This means we will attempt to request your webhook URL up to 7 times across roughly 1 hour.

Webhook Headers

The Uber API will insert specialized headers for all requests made to your webhook URL to help your application utilize them appropriately.

Header Description
X-Environment Indicates if this request is coming from the production or sandbox API.
X-Uber-Signature SHA256 hash of the request body, computed using the app’s signing key as the key.

Webhook Security

Webhook messages are signed so that your app can verify that the sender is Uber. Webhooks requests contain an X-Uber-Signature header. The value of this field is a hexadecimal HMAC signature of the webhook HTTP request body, using signing key of primary webhook url as a key and SHA256 as the hash function.

Python Example

digester = hmac.new(signing_key, webhook_body, hashlib.sha256)
return digester.hexdigest()

Due to a strict interpretation of the JSON specification by JavaScript, if there are backslashes sent in the POST body, they will be removed upon parsing. This prevents webhook receivers implemented in NodeJS from verifying the webhook signature accurately. We are working on removing all backslashes from the payload in order to avoid this situation and will remove this note when that work is done.

Polling

For critical applications, we recommend complementing your webhooks implementation with regular polling in case webhook notifications are lost.

Webhook Event Structure

Name Type Description
event_id string Unique event identifier, which can be used to ensure that events are only digested once.
event_time integer Unix timestamp of the time the event occurred.
event_type string The type of event that occurred.
resource_href string The URL of the resource being referenced. This URL can be called with your App’s bearer token to retrieve the full payload.
meta object The object containing additional information that is specific to the event_type.
meta.order_id string Unique identifier of the order this event was generated for.
meta.status string Status of the receipt. (CREATED/UPDATED)
meta.transaction_id string Unique identifier of the transaction this event was generated for.
meta.organization_id string Unique identifier of the organization this event was generated for.
partner_data object Partner specific payload. (Can have custom key value pairs) [Available for specific partners]
webhook_meta object The object containing additional information that is specific to the webhook.
webhook_meta.client_id string Client ID for the developer
webhook_meta.webhook_config_id string Unique identifier of the webhook type.
webhook_meta.webhook_msg_timestamp integer Unix timestamp of the time when the webhook event was pushed.
webhook_meta.webhook_msg_uuid string Unique identifier, which can be used to ensure that the webhooks are digested only once.
Example Webhook
Production trip
{
  "event_id": "EVENT_ID",
  "event_time": 1720436230,
  "event_type": "business_order.receipt",
  "meta": {
    "order_id": "ORDER_ID",
    "status": "UPDATED",
    "transaction_id": "TRANSACTION_ID",
    "organization_id": "ORGANIZATION_ID"
  },
  "partner_data": {
    "partner_data_1": "partner_data_1",
    "partner_data_2": "partner_data_2"
  },
  "resource_href": "https://api.uber.com/v1/business/orders/ORDER_ID/receipt",
  "webhook_meta": {
    "client_id": "CLIENT_ID",
    "webhook_config_id": "u4b-business.receipt",
    "webhook_msg_timestamp": 1720436249,
    "webhook_msg_uuid": "WEBHOOK_ID"
  }
}
Sandbox trip
{
  "event_id": "EVENT_ID",
  "event_time": 1720436230,
  "event_type": "business_order.receipt",
  "meta": {
    "order_id": "ORDER_ID",
    "status": "CREATED",
    "transaction_id": "TRANSACTION_ID",
    "organization_id": "ORGANIZATION_ID"
  },
  "partner_data": {
    "partner_data_1": "partner_data_1",
    "partner_data_2": "partner_data_2"
  },
  "resource_href": "https://sandbox-api.uber.com/v1/business/orders/ORDER_ID/receipt",
  "webhook_meta": {
    "client_id": "CLIENT_ID",
    "webhook_config_id": "u4b-business.receipt",
    "webhook_msg_timestamp": 1720436249,
    "webhook_msg_uuid": "WEBHOOK_ID"
  }
}

Uber

Developers
© 2023 Uber Technologies Inc.