openapi: 3.0.3
info:
  title: Remit Score by Wapipay
  version: 1.0.0
  description: API for authorization and fetching consumer credit score

servers:
  - url: https://sandbox-v2.wapipay.com
    description: Remit Score API
  - url: https://remitscoreauth.wapipay.com
    description: Auth Server

paths:
  /api/v1/reports/consumer:
    post:
      summary: Get Consumer Credit Score
      operationId: getConsumerCreditScore
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                phoneNumberx:
                  type: string
                  example: "+254721795388"
      responses:
        '200':
          description: Successful response
        '401':
          description: Unauthorized

  /oauth2/token:
    post:
      summary: Get Access Token
      operationId: getAccessToken
      security:
        - basicAuth: []
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
                - grant_type
              properties:
                grant_type:
                  type: string
                  example: client_credentials
                client_id:
                  type: string
                  example: wapipay-test-client
                client_secret:
                  type: string
                  example: wapipay-test-secret
      responses:
        '200':
          description: Token response
        '400':
          description: Bad request

components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

    basicAuth:
      type: http
      scheme: basic
