{
  "openapi": "3.0.3",
  "info": {"title": "LaxoPay API", "version": "2026-10-03", "description": "Test-mode payments API. Live keys return live_mode_unavailable."},
  "servers": [{"url": "https://api.laxopay.com/v1"}],
  "components": {
    "securitySchemes": {"bearer": {"type": "http", "scheme": "bearer"}},
    "schemas": {
      "Payment": {"type": "object", "properties": {
        "id": {"type": "string"}, "object": {"type": "string", "example": "payment"},
        "amount": {"type": "integer"}, "currency": {"type": "string"}, "status": {"type": "string"},
        "fee": {"type": "integer"}, "amount_refunded": {"type": "integer"}, "livemode": {"type": "boolean"}
      }},
      "Error": {"type": "object", "properties": {"error": {"type": "object"}}}
    }
  },
  "security": [{"bearer": []}],
  "paths": {
    "/": {"get": {"security": [], "summary": "API index", "responses": {"200": {"description": "Index"}}}},
    "/payments": {
      "get": {"summary": "List payments", "parameters": [{"name": "limit", "in": "query", "schema": {"type": "integer"}}], "responses": {"200": {"description": "List"}}},
      "post": {"summary": "Create a payment", "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}}], "responses": {"200": {"description": "Payment"}, "402": {"description": "Card declined"}}}
    },
    "/payments/{id}": {"get": {"summary": "Retrieve a payment", "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "Payment"}}}},
    "/payments/{id}/confirm": {"post": {"summary": "Confirm a payment", "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "Payment"}, "402": {"description": "Card declined"}}}},
    "/payments/{id}/capture": {"post": {"summary": "Capture a payment", "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "Payment"}}}},
    "/payments/{id}/refund": {"post": {"summary": "Refund a payment", "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "Payment"}}}},
    "/customers": {
      "get": {"summary": "List customers", "responses": {"200": {"description": "List"}}},
      "post": {"summary": "Create a customer", "responses": {"200": {"description": "Customer"}}}
    },
    "/customers/{id}": {"get": {"summary": "Retrieve a customer", "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "Customer"}}}},
    "/payment_links": {"post": {"summary": "Create a payment link", "responses": {"200": {"description": "Payment link"}}}},
    "/payment_links/{id}": {"get": {"summary": "Retrieve a payment link", "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "Payment link"}}}},
    "/webhook_endpoints": {
      "get": {"summary": "List webhook endpoints", "responses": {"200": {"description": "List"}}},
      "post": {"summary": "Create a webhook endpoint", "responses": {"200": {"description": "Endpoint, including the signing secret"}}}
    },
    "/subscriptions": {"post": {"summary": "Create a test subscription", "responses": {"200": {"description": "Subscription"}}}},
    "/invoices": {"post": {"summary": "Create a test invoice", "responses": {"200": {"description": "Invoice"}}}},
    "/balance": {"get": {"summary": "Test ledger balance", "responses": {"200": {"description": "Balance"}}}}
  }
}
