334 lines
6.9 KiB
JSON
334 lines
6.9 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/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": "Upsert 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": {
|
|
"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}/action": {
|
|
"post": {
|
|
"summary": "Trigger order action (accept, deny, ready, cancel)",
|
|
"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/webhooks/uber": {
|
|
"post": {
|
|
"summary": "Ingest Uber webhook events",
|
|
"tags": [
|
|
"Webhooks"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Webhook accepted (empty body)"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": []
|
|
} |