Nestcoin auth-oauth API

The auth-oauth API from Nestcoin — 2 operation(s) for auth-oauth.

OpenAPI Specification

nestcoin-auth-oauth-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  version: 3.0.2
  title: Onboard External API Gateway auth-oauth API
  description: "**Introduction**\nAPI Gateway for Onboard\n\nThis specification describes API endpoints that are available to the public internet via the API gateway. The different endpoints require different authentication schemes, see documentation for what applies to the operation you want to access.\n\n**Errors**\nUses conventional HTTP response codes to indicate success or failure. In\ngeneral:\n \n- `2xx` status codes indicate success. Codes in the\n- `4xx` range\nindicate a client error (e.g. required parameters, failed request etc.).\n- `5xx` status codes indicate a server error occurred."
  contact:
    name: Nestcoin TechOps
    email: techops@nestcoin.com
  license:
    name: UNLICENSED
servers:
- url: https://external.dev.onboardpay.co
  description: Gateway for external API on staging environment.
tags:
- name: auth-oauth
paths:
  /auth/oauth/access-token:
    x-original-path: /oauth/access-token
    post:
      tags:
      - auth-oauth
      description: 'Request for access token by presenting previously acquired request token. Requires x-signature and x-timestamp header

        '
      summary: Request for access token
      x-visibility: external
      operationId: requestAccessToken
      security:
      - authSignature: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccessTokenRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessTokenResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageDto'
        '401':
          description: Unauthorized request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageDto'
        '403':
          description: Forbidden request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageDto'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageDto'
  /auth/oauth/refresh-token:
    x-original-path: /oauth/refresh-token
    post:
      tags:
      - auth-oauth
      description: 'Refresh access token by presenting previously acquired refresh token. Requires the refresh token initially acquired to be passed as x-auth-token in header

        '
      summary: Request for access token
      x-visibility: external
      operationId: refreshAccessToken
      security:
      - authToken: []
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessTokenResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageDto'
        '401':
          description: Unauthorized request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageDto'
        '403':
          description: Forbidden request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageDto'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageDto'
components:
  schemas:
    AccessTokenRequest:
      properties:
        requestToken:
          type: string
          description: Request token acquired when user granted access
        requestId:
          type: string
          description: Unique Request ID originally generated by requesting app but in plain text (not hashed)
        serviceIdentifier:
          type: string
          description: Service ID or API key of requesting app
      required:
      - requestToken
      - requestId
      - serviceIdentifier
      x-source-svc: auth
    AccessTokenResponse:
      properties:
        userId:
          type: string
          description: Onboard unique User ID
        accessToken:
          $ref: '#/components/schemas/Token'
        refreshToken:
          $ref: '#/components/schemas/Token'
      required:
      - userId
      - accessToken
      - refreshToken
      x-source-svc: auth
    ErrorMessageDto:
      description: Default error object for services. This gives consistent error object that all services may use.
      type: object
      required:
      - code
      - message
      properties:
        code:
          type: string
          description: Error code
          example: UNKNOWN_ERROR
        message:
          type: string
          description: Descriptive error message
          example: Request could not be completed due to an error
        data:
          type: object
          description: Additional data for this error message.
          additionalProperties: true
          properties: {}
      x-common-model: ErrorMessageDto
    Token:
      properties:
        token:
          type: string
          description: Token string (Request, Access, Refresh)
        expiry:
          type: string
          format: date-time
          description: Timestamp field.
          x-source-svc: auth
      required:
      - token
      - expiry
      x-source-svc: auth
  securitySchemes:
    authSignature:
      type: apiKey
      name: x-signature
      in: header
    authToken:
      type: apiKey
      name: x-auth-token
      in: header
      description: Auth Token header for inter-service communication
x-organization: onboard
x-service-id: external-gateway
x-preserve-refs:
- '#/components/schemas/IntegrationProduct'
- '#/components/schemas/AdAppliedEscrowBalanceDto'
- '#/components/schemas/P2PWalletRecipient'
- '#/components/schemas/BankAccountRecipient'
- '#/components/schemas/MobileMoneyRecipient'
- '#/components/schemas/OrderEvent'
- '#/components/schemas/PaymentMethodEventAction'
- '#/components/schemas/PaymentMethodEventPayload'
- '#/components/schemas/TransactionServiceErrorCode'
- '#/components/schemas/ErrorCodes'