724 lines
16 KiB
JSON
724 lines
16 KiB
JSON
{
|
|
"openapi": "3.0.3",
|
|
"info": {
|
|
"title": "Uber Wrapper API",
|
|
"version": "1.0.0",
|
|
"description": "Generic multi-merchant Uber API wrapper for POS platforms"
|
|
},
|
|
"servers": [
|
|
{
|
|
"url": "http://localhost:8080"
|
|
}
|
|
],
|
|
"components": {
|
|
"securitySchemes": {
|
|
"ApiKeyAuth": {
|
|
"type": "apiKey",
|
|
"in": "header",
|
|
"name": "x-api-key"
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"paths": {
|
|
"/api/v1/auth/uber/authorize-url": {
|
|
"get": {
|
|
"summary": "Generate Uber OAuth authorize URL for merchant",
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "query",
|
|
"name": "merchantId",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OAuth URL generated"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/auth/uber/callback": {
|
|
"get": {
|
|
"summary": "Uber OAuth callback endpoint",
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Uber account connected"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/auth/uber/client-credentials-token": {
|
|
"post": {
|
|
"summary": "Get cached or live Uber client credentials token",
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Token generated"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/auth/uber/capabilities": {
|
|
"get": {
|
|
"summary": "Get Uber auth grants, scopes, and token-rate-limit metadata",
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Auth capability details"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/auth/uber/{merchantId}/refresh-token": {
|
|
"post": {
|
|
"summary": "Refresh Uber token for merchant",
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "merchantId",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Token refreshed"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/auth/uber/domain-pairing-status": {
|
|
"get": {
|
|
"summary": "Validate Uber auth and API domain pairing",
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Domain mapping status"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/merchants": {
|
|
"post": {
|
|
"summary": "Create or update merchant",
|
|
"tags": [
|
|
"Merchants"
|
|
],
|
|
"responses": {
|
|
"201": {
|
|
"description": "Merchant upserted"
|
|
}
|
|
}
|
|
},
|
|
"get": {
|
|
"summary": "List merchants",
|
|
"tags": [
|
|
"Merchants"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Merchant list"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/connections/uber": {
|
|
"post": {
|
|
"summary": "Save manual Uber tokens for merchant",
|
|
"tags": [
|
|
"Connections"
|
|
],
|
|
"responses": {
|
|
"201": {
|
|
"description": "Connection stored"
|
|
}
|
|
}
|
|
},
|
|
"get": {
|
|
"summary": "List Uber connections",
|
|
"tags": [
|
|
"Connections"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Connection list"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/health": {
|
|
"get": {
|
|
"summary": "Health check",
|
|
"tags": [
|
|
"Health"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Service is healthy"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/metrics/injection-success": {
|
|
"get": {
|
|
"summary": "Get order injection success metric",
|
|
"tags": [
|
|
"Metrics"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "query",
|
|
"name": "merchantId",
|
|
"required": false,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"in": "query",
|
|
"name": "windowDays",
|
|
"required": false,
|
|
"schema": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Injection metrics"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/metrics/order-response-sla": {
|
|
"get": {
|
|
"summary": "Get response SLA metric for order accept/deny timing",
|
|
"tags": [
|
|
"Metrics"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "query",
|
|
"name": "merchantId",
|
|
"required": false,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"in": "query",
|
|
"name": "windowDays",
|
|
"required": false,
|
|
"schema": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "SLA metrics"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/metrics/go-live-readiness": {
|
|
"get": {
|
|
"summary": "Check pilot go-live readiness based on 3-day injection success threshold",
|
|
"tags": [
|
|
"Metrics"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "query",
|
|
"name": "merchantId",
|
|
"required": false,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"in": "query",
|
|
"name": "thresholdPercent",
|
|
"required": false,
|
|
"schema": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Go-live readiness status"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/uber/request": {
|
|
"post": {
|
|
"summary": "Generic Uber passthrough for any Uber endpoint",
|
|
"tags": [
|
|
"Uber Generic"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Uber response"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/uber/menu/upsert": {
|
|
"post": {
|
|
"summary": "Legacy upsert helper for store menu",
|
|
"tags": [
|
|
"Uber Menu"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Menu upserted"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/uber/menu/replace": {
|
|
"put": {
|
|
"summary": "Replace store menu (full upload)",
|
|
"tags": [
|
|
"Uber Menu"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Menu replaced"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/uber/menu/items": {
|
|
"post": {
|
|
"summary": "Update individual menu items (stock/price updates)",
|
|
"tags": [
|
|
"Uber Menu"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Menu items updated"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/uber/menu": {
|
|
"get": {
|
|
"summary": "Fetch store menu",
|
|
"tags": [
|
|
"Uber Menu"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Menu fetched"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/uber/orders": {
|
|
"get": {
|
|
"summary": "List store orders",
|
|
"tags": [
|
|
"Uber Orders"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Orders fetched"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/uber/orders/{orderId}": {
|
|
"get": {
|
|
"summary": "Retrieve full order details by order ID",
|
|
"tags": [
|
|
"Uber Orders"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "orderId",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Order details retrieved"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/uber/orders/{orderId}/fulfillment-issues": {
|
|
"post": {
|
|
"summary": "Resolve retail fulfillment issues (found/partial/out-of-stock substitutions)",
|
|
"tags": [
|
|
"Uber Orders"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "orderId",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Fulfillment issue update submitted"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/uber/orders/{orderId}/ready": {
|
|
"post": {
|
|
"summary": "Mark order ready for handoff/pickup",
|
|
"tags": [
|
|
"Uber Orders"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "orderId",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Order marked ready"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/uber/stores": {
|
|
"get": {
|
|
"summary": "Retrieve all stores provisioned to developer account",
|
|
"tags": [
|
|
"Uber Stores"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Stores retrieved"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/uber/stores/provisionable": {
|
|
"get": {
|
|
"summary": "Retrieve stores associated with merchant OAuth token",
|
|
"tags": [
|
|
"Uber Provisioning"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "query",
|
|
"name": "merchantId",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Stores retrieved"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/uber/stores/{storeId}": {
|
|
"get": {
|
|
"summary": "Retrieve store details by store ID",
|
|
"tags": [
|
|
"Uber Stores"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "storeId",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Store retrieved"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/uber/stores/{storeId}/status": {
|
|
"get": {
|
|
"summary": "Retrieve store online/offline status",
|
|
"tags": [
|
|
"Uber Stores"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "storeId",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Store status retrieved"
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"summary": "Set store online/offline status",
|
|
"tags": [
|
|
"Uber Stores"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "storeId",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Store status updated"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/uber/stores/{storeId}/holiday-hours": {
|
|
"get": {
|
|
"summary": "Retrieve store holiday hours",
|
|
"tags": [
|
|
"Uber Stores"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "storeId",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Holiday hours retrieved"
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"summary": "Set store holiday hours",
|
|
"tags": [
|
|
"Uber Stores"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "storeId",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Holiday hours updated"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/uber/orders/{orderId}/action": {
|
|
"post": {
|
|
"summary": "Trigger order action (accept, deny, ready, cancel, resolve)",
|
|
"tags": [
|
|
"Uber Orders"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "orderId",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Order action sent"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/uber/stores/hours": {
|
|
"put": {
|
|
"summary": "Update store hours",
|
|
"tags": [
|
|
"Uber Stores"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Store hours updated"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/uber/stores/{storeId}/pos-data": {
|
|
"post": {
|
|
"summary": "Activate integration for selected store (POST /pos_data)",
|
|
"tags": [
|
|
"Uber Provisioning"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "storeId",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Store provisioned"
|
|
}
|
|
}
|
|
},
|
|
"get": {
|
|
"summary": "Retrieve integration configuration for selected store (GET /pos_data)",
|
|
"tags": [
|
|
"Uber Provisioning"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "storeId",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Store integration configuration retrieved"
|
|
}
|
|
}
|
|
},
|
|
"patch": {
|
|
"summary": "Update integration settings for selected store (PATCH /pos_data)",
|
|
"tags": [
|
|
"Uber Provisioning"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "storeId",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Store integration updated"
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"summary": "De-provision integration for selected store (DELETE /pos_data)",
|
|
"tags": [
|
|
"Uber Provisioning"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "storeId",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Store integration removed"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/uber/reporting/fetch": {
|
|
"post": {
|
|
"summary": "Fetch Uber reporting CSV with retries and header-based parsing",
|
|
"tags": [
|
|
"Uber Reporting"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Reporting CSV fetched"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/webhooks/uber": {
|
|
"post": {
|
|
"summary": "Ingest Uber webhook events",
|
|
"tags": [
|
|
"Webhooks"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Webhook accepted (empty body)"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": []
|
|
} |