{
  "openapi": "3.0.3",
  "info": {
    "title": "Wallet SSO API",
    "version": "1.0.0",
    "description": "OpenAPI specification for the Wallet service API."
  },
  "servers": [
    {
      "url": "https://staging-api.yourflexpay.com/v2",
      "description": "Staging"
    },
    {
      "url": "https://sandbox-api.yourflexpay.com/v2",
      "description": "Sandbox"
    },
    {
      "url": "https://api.yourflexpay.com/v2",
      "description": "Live"
    }
  ],
  "tags": [
    {
      "name": "SSO Auth"
    },
    {
      "name": "SSO Wallet"
    },
    {
      "name": "SSO Transaction"
    },
    {
      "name": "SSO Payment Request"
    },
    {
      "name": "SSO PayTag"
    },
    {
      "name": "SSO QR"
    },
    {
      "name": "SSO Beneficiary"
    }
  ],
  "security": [
    {
      "PartnerIdHeader": [],
      "PartnerApiKeyHeader": []
    }
  ],
  "paths": {
    "/sso/me": {
      "get": {
        "tags": [
          "SSO Auth"
        ],
        "summary": "Get the authenticated user's PayTag identity",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": [],
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Authenticated user's PayTag and connected host",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SsoAuthenticatedPayTag"
                }
              }
            }
          }
        }
      }
    },
    "/sso/auth-code": {
      "post": {
        "tags": [
          "SSO Auth"
        ],
        "summary": "Authorize a user and return redirect URL with auth-code",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "scope",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "profile"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PayTagSsoAuthRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Redirect URL with auth-code",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/sso/token": {
      "get": {
        "tags": [
          "SSO Auth"
        ],
        "summary": "Exchange auth-code for customer token",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "auth-code",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SSO customer token",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/sso/verify-tag": {
      "get": {
        "tags": [
          "SSO Auth"
        ],
        "summary": "Verify paytag availability",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "tag",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Availability status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TagAvailabilityResponse"
                }
              }
            }
          }
        }
      }
    },
    "/sso/create-tag": {
      "post": {
        "tags": [
          "SSO Auth"
        ],
        "summary": "Initiate customer onboarding for tag creation",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "otp",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerInitiateOnboardingRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Onboarding session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerOnboardingDto"
                }
              }
            }
          }
        }
      }
    },
    "/sso/create-tag/{onboarding}": {
      "get": {
        "tags": ["SSO Auth"],
        "summary": "Get onboarding payload",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "onboarding",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Onboarding payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerOnboardingDto"
                }
              }
            }
          }
        }
      }
    },
    "/sso/create-tag/{onboarding}/otp": {
      "get": {
        "tags": [
          "SSO Auth"
        ],
        "summary": "Send onboarding OTP",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "onboarding",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "channel",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "sms",
                "whatsapp",
                "email"
              ]
            }
          },
          {
            "in": "query",
            "name": "recipient",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OTP metadata",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerOnboardingOtp"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "SSO Auth"
        ],
        "summary": "Validate onboarding OTP",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "onboarding",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "code"
                ],
                "properties": {
                  "code": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated onboarding payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerOnboardingDto"
                }
              }
            }
          }
        }
      }
    },
    "/sso/create-tag/{onboarding}/complete": {
      "post": {
        "tags": [
          "SSO Auth"
        ],
        "summary": "Complete onboarding and create PayTag",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "onboarding",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerOnboardingCompleteRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "SSO customer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PayTagSso"
                }
              }
            }
          }
        }
      }
    },
    "/sso/wallet": {
      "get": {
        "tags": [
          "SSO Wallet"
        ],
        "summary": "Get host-scoped wallet for authenticated customer",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": [],
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Wallet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Wallet"
                }
              }
            }
          }
        }
      }
    },
    "/sso/wallet/bank-account": {
      "post": {
        "tags": [
          "SSO Wallet"
        ],
        "summary": "Link bank account to wallet",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": [],
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BankAccountDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Bank account linked"
          }
        }
      }
    },
    "/sso/wallet/history": {
      "get": {
        "tags": [
          "SSO Wallet"
        ],
        "summary": "Get wallet history",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": [],
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/LimitQuery"
          },
          {
            "$ref": "#/components/parameters/OffsetQuery"
          },
          {
            "$ref": "#/components/parameters/StartDateQuery"
          },
          {
            "$ref": "#/components/parameters/EndDateQuery"
          },
          {
            "in": "query",
            "name": "type",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "reference",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "search",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "currency",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Wallet with paginated history",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletHistoryResponse"
                }
              }
            }
          }
        }
      }
    },
    "/sso/wallet/history/{reference}": {
      "get": {
        "tags": [
          "SSO Wallet"
        ],
        "summary": "Get wallet histories by reference",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": [],
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "reference",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Wallet histories",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WalletHistory"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/sso/wallet/summary": {
      "get": {
        "tags": [
          "SSO Wallet"
        ],
        "summary": "Get wallet summary",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": [],
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Wallet summary keyed by category",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "$ref": "#/components/schemas/WalletSummary"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/sso/wallet/limit": {
      "get": {
        "tags": [
          "SSO Wallet"
        ],
        "summary": "Get daily transaction limit and spend",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": [],
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "transaction",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Limit details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Limit": {
                      "type": "number"
                    },
                    "Spent": {
                      "type": "number"
                    },
                    "Remaining": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/sso/wallet/v-account": {
      "get": {
        "tags": [
          "SSO Wallet"
        ],
        "summary": "Get wallet virtual accounts (creates one if none exists)",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": [],
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Virtual accounts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WalletStaticVirtualAccount"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/sso/transaction/withdraw": {
      "post": {
        "tags": [
          "SSO Transaction"
        ],
        "summary": "Withdraw from customer wallet to bank account number",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": [],
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/TransactionDto"
                  },
                  {
                    "type": "object",
                    "required": [
                      "accountNumber"
                    ],
                    "properties": {
                      "accountNumber": {
                        "type": "string"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Transaction details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionDetail"
                }
              }
            }
          }
        }
      }
    },
    "/sso/transaction/p2p": {
      "post": {
        "tags": [
          "SSO Transaction"
        ],
        "summary": "Transfer from customer wallet to another paytag",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": [],
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/P2pTransactionDto"
                  },
                  {
                    "type": "object",
                    "required": [
                      "recipient"
                    ],
                    "properties": {
                      "recipient": {
                        "type": "string"
                      },
                      "saveBeneficiary": {
                        "type": "boolean"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Transaction details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionDetail"
                }
              }
            }
          }
        }
      }
    },
    "/sso/transaction/bank-transfer": {
      "post": {
        "tags": [
          "SSO Transaction"
        ],
        "summary": "Bank transfer from customer wallet",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": [],
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/TransactionDto"
                  },
                  {
                    "type": "object",
                    "description": "Must include bank account fields accepted by `BankAccountPipe`.",
                    "properties": {
                      "accountNumber": {
                        "type": "string"
                      },
                      "bankCode": {
                        "type": "string"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Transaction details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionDetail"
                }
              }
            }
          }
        }
      }
    },
    "/sso/transaction/statement": {
      "post": {
        "tags": [
          "SSO Transaction"
        ],
        "summary": "Get statement URL or trigger async statement generation",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": [],
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/StartDateQuery"
          },
          {
            "$ref": "#/components/parameters/EndDateQuery"
          },
          {
            "in": "query",
            "name": "async",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Statement URL (sync mode)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "204": {
            "description": "Async statement generation accepted"
          }
        }
      }
    },
    "/sso/transaction": {
      "get": {
        "tags": [
          "SSO Transaction"
        ],
        "summary": "Get customer wallet transactions",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": [],
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/LimitQuery"
          },
          {
            "$ref": "#/components/parameters/OffsetQuery"
          },
          {
            "$ref": "#/components/parameters/StartDateQuery"
          },
          {
            "$ref": "#/components/parameters/EndDateQuery"
          },
          {
            "in": "query",
            "name": "type",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "reference",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "search",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "currency",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Wallet and paginated transactions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/sso/transaction/{reference}": {
      "get": {
        "tags": [
          "SSO Transaction"
        ],
        "summary": "Get transaction by reference",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": [],
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "reference",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transaction details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionDetail"
                }
              }
            }
          }
        }
      }
    },
    "/sso/request": {
      "post": {
        "tags": [
          "SSO Payment Request"
        ],
        "summary": "Create payment request",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": [],
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/PaymentRequestDto"
                  },
                  {
                    "type": "object",
                    "required": [
                      "payer"
                    ],
                    "properties": {
                      "payer": {
                        "type": "string"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Payment request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentRequest"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "SSO Payment Request"
        ],
        "summary": "List payment requests",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": [],
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/LimitQuery"
          },
          {
            "$ref": "#/components/parameters/OffsetQuery"
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "role",
            "schema": {
              "type": "string",
              "enum": [
                "Initiator",
                "Payer"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated payment requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedPaymentRequest"
                }
              }
            }
          }
        }
      }
    },
    "/sso/request/{id}": {
      "get": {
        "tags": [
          "SSO Payment Request"
        ],
        "summary": "Get payment request by id",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": [],
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payment request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentRequest"
                }
              }
            }
          }
        }
      }
    },
    "/sso/request/{id}/accept": {
      "post": {
        "tags": [
          "SSO Payment Request"
        ],
        "summary": "Accept payment request and execute transfer",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": [],
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transaction details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionDetail"
                }
              }
            }
          }
        }
      }
    },
    "/sso/request/{id}/cancel": {
      "post": {
        "tags": [
          "SSO Payment Request"
        ],
        "summary": "Cancel payment request",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": [],
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payment request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentRequest"
                }
              }
            }
          }
        }
      }
    },
    "/sso/request/{id}/decline": {
      "post": {
        "tags": [
          "SSO Payment Request"
        ],
        "summary": "Decline payment request",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": [],
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payment request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentRequest"
                }
              }
            }
          }
        }
      }
    },
    "/sso/paytag/search": {
      "get": {
        "tags": [
          "SSO PayTag"
        ],
        "summary": "Search paytags",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": [],
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated paytags",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedPayTag"
                }
              }
            }
          }
        }
      }
    },
    "/sso/paytag/{tag}": {
      "get": {
        "tags": [
          "SSO PayTag"
        ],
        "summary": "Resolve paytag details",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": [],
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "tag",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paytag",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PayTag"
                }
              }
            }
          }
        }
      }
    },
    "/sso/paytag/{tag}/hosts": {
      "get": {
        "tags": [
          "SSO PayTag"
        ],
        "summary": "List hosts connected to paytag through wallet provisioning",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": [],
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "tag",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Connected hosts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PayTagSsoConnectedHostDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/sso/qr": {
      "get": {
        "tags": [
          "SSO QR"
        ],
        "summary": "Generate a QR code base64 image for paytag",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": [],
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "amount",
            "required": false,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "QR payload",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "SSO QR"
        ],
        "summary": "Complete a QR payment transaction",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": [],
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QrTransactionDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Transaction details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionDetail"
                }
              }
            }
          }
        }
      }
    },
    "/sso/qr/{reference}": {
      "get": {
        "tags": [
          "SSO QR"
        ],
        "summary": "Get QR transaction data by reference",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": [],
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "reference",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "QR transaction data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ITransactionQr"
                }
              }
            }
          }
        }
      }
    },
    "/sso/beneficiary": {
      "post": {
        "tags": [
          "SSO Beneficiary"
        ],
        "summary": "Save paytag beneficiary",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": [],
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "paytag"
                ],
                "properties": {
                  "paytag": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved beneficiary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PayTagBeneficiary"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "SSO Beneficiary"
        ],
        "summary": "Get paytag beneficiaries",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": [],
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Beneficiary paytags",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PayTag"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "SSO Beneficiary"
        ],
        "summary": "Remove paytag beneficiary",
        "security": [
          {
            "ClientIdHeader": [],
            "ApiKeyHeader": [],
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "paytag"
                ],
                "properties": {
                  "paytag": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deletion status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ClientIdHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "x-client-id"
      },
      "ApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      },
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "parameters": {
      "LimitQuery": {
        "in": "query",
        "name": "limit",
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "OffsetQuery": {
        "in": "query",
        "name": "offset",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      },
      "StartDateQuery": {
        "in": "query",
        "name": "startDate",
        "schema": {
          "type": "string",
          "format": "date"
        }
      },
      "EndDateQuery": {
        "in": "query",
        "name": "endDate",
        "schema": {
          "type": "string",
          "format": "date"
        }
      }
    },
    "schemas": {
      "PayTagSsoAuthRequestDto": {
        "type": "object",
        "required": [
          "paytag",
          "password"
        ],
        "properties": {
          "paytag": {
            "type": "string"
          },
          "password": {
            "type": "string"
          }
        }
      },
      "CustomerInitiateOnboardingRequestDto": {
        "type": "object",
        "required": [
          "bvn"
        ],
        "properties": {
          "bvn": {
            "type": "string",
            "pattern": "^[0-9]{11}$"
          },
          "uid": {
            "type": "string"
          },
          "referrer": {
            "type": "string"
          }
        }
      },
      "CustomerOnboardingCompleteRequestDto": {
        "type": "object",
        "required": [
          "tag",
          "password"
        ],
        "properties": {
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "otherName": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "tag": {
            "type": "string"
          },
          "profileImage": {
            "type": "string"
          },
          "password": {
            "type": "string"
          }
        }
      },
      "CustomerOnboardingOtp": {
        "type": "object",
        "properties": {
          "provider": {
            "type": "string"
          },
          "reference": {
            "type": "string"
          },
          "recipients": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "validated": {
            "type": "boolean"
          }
        }
      },
      "CustomerOnboardingDto": {
        "type": "object",
        "additionalProperties": true
      },
      "PayTagSso": {
        "type": "object",
        "additionalProperties": true
      },
      "TagAvailabilityResponse": {
        "type": "object",
        "properties": {
          "availability": {
            "type": "boolean"
          },
          "tag": {
            "type": "string"
          }
        }
      },
      "TransactionDto": {
        "type": "object",
        "required": [
          "amount"
        ],
        "properties": {
          "amount": {
            "type": "number",
            "maximum": 999999999
          },
          "comment": {
            "type": "string",
            "maxLength": 250
          },
          "reference": {
            "type": "string",
            "maxLength": 100
          },
          "currency": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "P2pTransactionDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/TransactionDto"
          },
          {
            "type": "object",
            "required": [
              "recipient"
            ],
            "properties": {
              "recipient": {
                "type": "string"
              },
              "senderHostId": {
                "type": "number"
              },
              "recipientHostId": {
                "type": "number"
              }
            }
          }
        ]
      },
      "QrTransactionDto": {
        "type": "object",
        "required": [
          "Type",
          "Amount"
        ],
        "properties": {
          "Tag": {
            "type": "string"
          },
          "Name": {
            "type": "string"
          },
          "Email": {
            "type": "string"
          },
          "Type": {
            "type": "string",
            "enum": [
              "Customer",
              "Merchant",
              "MerchantUser",
              "Partner"
            ]
          },
          "QrType": {
            "type": "string",
            "enum": [
              "P2P Transaction",
              "Partner Transaction",
              "Split Transaction",
              "Flex Terminal Transaction",
              "Partner Terminal Transaction"
            ]
          },
          "Amount": {
            "type": "number",
            "minimum": 1
          },
          "HostID": {
            "type": "number"
          },
          "Reference": {
            "type": "string"
          },
          "Description": {
            "type": "string"
          },
          "Metadata": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "ITransactionQr": {
        "type": "object",
        "required": [
          "Tag",
          "Name",
          "Email",
          "Type",
          "Amount"
        ],
        "properties": {
          "Tag": {
            "type": "string"
          },
          "Name": {
            "type": "string"
          },
          "Email": {
            "type": "string"
          },
          "Type": {
            "type": "string",
            "enum": [
              "AdminAuth",
              "Customer",
              "Merchant",
              "MerchantUser",
              "Partner"
            ]
          },
          "Amount": {
            "type": "number"
          },
          "HostID": {
            "type": "number"
          },
          "QrType": {
            "type": "string",
            "enum": [
              "P2P Transaction",
              "Partner Transaction",
              "Split Transaction",
              "Flex Terminal Transaction",
              "Partner Terminal Transaction"
            ]
          },
          "Reference": {
            "type": "string"
          },
          "Description": {
            "type": "string"
          },
          "Metadata": {
            "type": "object",
            "additionalProperties": true
          },
          "Timestamp": {
            "type": "number"
          },
          "VirtualAccount": {
            "$ref": "#/components/schemas/DynamicVirtualAccount"
          },
          "Payment": {
            "$ref": "#/components/schemas/TransactionDetail"
          }
        }
      },
      "DynamicVirtualAccount": {
        "type": "object",
        "required": [
          "AccountName",
          "AccountNumber",
          "BankName",
          "Reference"
        ],
        "properties": {
          "AccountName": {
            "type": "string"
          },
          "AccountNumber": {
            "type": "string"
          },
          "BankName": {
            "type": "string"
          },
          "Reference": {
            "type": "string"
          },
          "ExpiresAt": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "PaymentRequestDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/TransactionDto"
          },
          {
            "type": "object",
            "properties": {
              "duration": {
                "type": "number"
              },
              "hostId": {
                "type": "number"
              },
              "payerHostId": {
                "type": "number"
              }
            }
          }
        ]
      },
      "BankAccountDto": {
        "type": "object",
        "required": [
          "accountNumber",
          "bankCode"
        ],
        "properties": {
          "accountNumber": {
            "type": "string"
          },
          "bankCode": {
            "type": "string"
          }
        }
      },
      "Wallet": {
        "type": "object",
        "additionalProperties": true
      },
      "WalletHistory": {
        "type": "object",
        "additionalProperties": true
      },
      "WalletSummary": {
        "type": "object",
        "additionalProperties": true
      },
      "WalletStaticVirtualAccount": {
        "type": "object",
        "additionalProperties": true
      },
      "PaymentRequest": {
        "type": "object",
        "additionalProperties": true
      },
      "TransactionDetail": {
        "type": "object",
        "additionalProperties": true
      },
      "PayTag": {
        "type": "object",
        "additionalProperties": true
      },
      "PayTagBeneficiary": {
        "type": "object",
        "properties": {
          "ID": {
            "type": "integer"
          },
          "PayTag": {
            "$ref": "#/components/schemas/PayTag"
          },
          "Beneficiary": {
            "$ref": "#/components/schemas/PayTag"
          },
          "CreatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "UpdatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "DeletedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "PayTagSsoConnectedHostDto": {
        "type": "object",
        "required": [
          "ID",
          "Name",
          "LogoUrl"
        ],
        "properties": {
          "ID": {
            "type": "integer"
          },
          "LogoUrl": {
            "type": "string"
          },
          "Name": {
            "type": "string"
          }
        }
      },
      "SsoAuthenticatedPayTag": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PayTag"
          },
          {
            "type": "object",
            "required": [
              "Host"
            ],
            "properties": {
              "Host": {
                "$ref": "#/components/schemas/PayTagSsoConnectedHostDto"
              }
            }
          }
        ]
      },
      "WalletHistoryResponse": {
        "type": "object",
        "properties": {
          "Wallet": {
            "$ref": "#/components/schemas/Wallet"
          },
          "History": {
            "$ref": "#/components/schemas/PaginatedWalletHistory"
          }
        }
      },
      "PaginatedWalletHistory": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WalletHistory"
            }
          },
          "count": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        }
      },
      "TransactionListResponse": {
        "type": "object",
        "properties": {
          "Wallet": {
            "$ref": "#/components/schemas/Wallet"
          },
          "Transactions": {
            "$ref": "#/components/schemas/PaginatedTransactionDetail"
          }
        }
      },
      "PaginatedTransactionDetail": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TransactionDetail"
            }
          },
          "count": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        }
      },
      "PaginatedPaymentRequest": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PaymentRequest"
            }
          },
          "count": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        }
      },
      "PaginatedPayTag": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PayTag"
            }
          },
          "count": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        }
      }
    }
  }
}
