openapi: 3.1.0 info: title: Api version: 0.1.0 description: UrbanThreads x Gameball API servers: - url: /api description: Base API path tags: - name: health description: Health operations - name: gameball description: Gameball integration endpoints paths: /healthz: get: operationId: healthCheck tags: [health] summary: Health check responses: "200": description: Healthy content: application/json: schema: $ref: "#/components/schemas/HealthStatus" /gameball/register: post: operationId: registerCustomer tags: [gameball] summary: Register a new customer in Gameball requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/RegisterCustomerRequest" responses: "200": description: Customer registered content: application/json: schema: $ref: "#/components/schemas/RegisterCustomerResponse" /gameball/event: post: operationId: sendEvent tags: [gameball] summary: Send a custom event to Gameball requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/SendEventRequest" responses: "200": description: Event sent content: application/json: schema: $ref: "#/components/schemas/SendEventResponse" /gameball/order: post: operationId: placeOrder tags: [gameball] summary: Place an order and earn points requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/PlaceOrderRequest" responses: "200": description: Order placed and points awarded content: application/json: schema: $ref: "#/components/schemas/PlaceOrderResponse" /gameball/redeem: post: operationId: redeemPoints tags: [gameball] summary: Redeem points for a discount requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/RedeemPointsRequest" responses: "200": description: Points redeemed content: application/json: schema: $ref: "#/components/schemas/RedeemPointsResponse" /gameball/profile/{playerUniqueId}: get: operationId: getCustomerProfile tags: [gameball] summary: Get customer profile with points, tier, and badges parameters: - name: playerUniqueId in: path required: true schema: type: string responses: "200": description: Customer profile content: application/json: schema: $ref: "#/components/schemas/CustomerProfile" components: schemas: HealthStatus: type: object properties: status: type: string required: - status RegisterCustomerRequest: type: object properties: playerUniqueId: type: string displayName: type: string email: type: string mobile: type: string required: - playerUniqueId - displayName - email RegisterCustomerResponse: type: object properties: success: type: boolean message: type: string playerUniqueId: type: string pointsBalance: type: number required: - success - message - playerUniqueId - pointsBalance SendEventRequest: type: object properties: playerUniqueId: type: string eventName: type: string metadata: type: object additionalProperties: true required: - playerUniqueId - eventName SendEventResponse: type: object properties: success: type: boolean message: type: string eventName: type: string pointsEarned: type: number required: - success - message - eventName - pointsEarned LineItem: type: object properties: name: type: string sku: type: string quantity: type: number unitPrice: type: number required: - name - sku - quantity - unitPrice PlaceOrderRequest: type: object properties: playerUniqueId: type: string orderReference: type: string totalAmount: type: number lineItems: type: array items: $ref: "#/components/schemas/LineItem" redeemPoints: type: number required: - playerUniqueId - orderReference - totalAmount - lineItems PlaceOrderResponse: type: object properties: success: type: boolean message: type: string orderReference: type: string pointsEarned: type: number pointsRedeemed: type: number discountApplied: type: number newPointsBalance: type: number required: - success - message - orderReference - pointsEarned - pointsRedeemed - discountApplied - newPointsBalance RedeemPointsRequest: type: object properties: playerUniqueId: type: string points: type: number orderReference: type: string required: - playerUniqueId - points - orderReference RedeemPointsResponse: type: object properties: success: type: boolean message: type: string pointsRedeemed: type: number discountAmount: type: number remainingBalance: type: number required: - success - message - pointsRedeemed - discountAmount - remainingBalance Badge: type: object properties: badgeId: type: string name: type: string description: type: string imageUrl: type: string achieved: type: boolean progress: type: number progressTarget: type: number required: - badgeId - name - description - imageUrl - achieved - progress - progressTarget CustomerProfile: type: object properties: playerUniqueId: type: string displayName: type: string email: type: string pointsBalance: type: number tier: type: string tierLevel: type: number nextTier: type: string pointsToNextTier: type: number badges: type: array items: $ref: "#/components/schemas/Badge" required: - playerUniqueId - displayName - email - pointsBalance - tier - tierLevel - nextTier - pointsToNextTier - badges