Spare Connection API

The Connection API from Spare — 4 operation(s) for connection.

OpenAPI Specification

spare-connection-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Information Account Connection API
  description: Spare account information API documentation
  termsOfService: https://terms.tryspare.com/en
  contact:
    name: Spare Technologies WLL.
    email: hello@tryspare.com
  license:
    name: Spare Technologies WLL.
  version: '1.0'
security:
- Bearer: []
tags:
- name: Connection
paths:
  /api/v1.0/ais/Connection/Create:
    post:
      tags:
      - Connection
      summary: Create connection
      description: '**Unique resource name :** ais.v1.connection.create'
      parameters:
      - name: providerId
        in: query
        description: Provider id
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectApiResponse'
        '402':
          description: Payment Required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectApiResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectApiResponse'
        '500':
          description: Internal Server Error
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountInformationConnectionResponseModelApiResponse'
        '400':
          description: '- If provider id is not valid'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectApiResponse'
        '404':
          description: '- If provider does not exist'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectApiResponse'
  /api/v1.0/ais/Connection/Get:
    get:
      tags:
      - Connection
      summary: Get connection by id
      description: '**Unique resource name :** ais.v1.connection.get'
      parameters:
      - name: id
        in: query
        description: Connection id
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectApiResponse'
        '402':
          description: Payment Required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectApiResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectApiResponse'
        '500':
          description: Internal Server Error
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountInformationConnectionResponseModelApiResponse'
        '400':
          description: '- If connection id is not valid'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectApiResponse'
        '404':
          description: '- If connection does not exists'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectApiResponse'
  /api/v1.0/ais/Connection/List:
    get:
      tags:
      - Connection
      summary: List connections
      description: '**Unique resource name :** ais.v1.connection.list'
      parameters:
      - name: page
        in: query
        description: Page number
        schema:
          type: integer
          format: int32
          default: '1'
      - name: perPage
        in: query
        description: Number of items per page maximum allow is 500 per page
        schema:
          type: integer
          format: int32
          default: '100'
      - name: providerId
        in: query
        description: Provider id (optional)
        schema:
          type: string
          format: uuid
      responses:
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectApiResponse'
        '402':
          description: Payment Required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectApiResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectApiResponse'
        '500':
          description: Internal Server Error
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountInformationConnectionResponseModelIEnumerablePagesModelMetaApiResponse'
        '400':
          description: '- If page is not valid

            - If perPage is not valid

            - If provider id is not valid'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectApiResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectApiResponse'
  /api/v1.0/ais/Connection/Delete:
    delete:
      tags:
      - Connection
      summary: Delete connection by id
      description: '**Unique resource name :** ais.v1.connection.delete'
      parameters:
      - name: id
        in: query
        description: ''
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectApiResponse'
        '402':
          description: Payment Required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectApiResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectApiResponse'
        '500':
          description: Internal Server Error
        '204':
          description: ''
        '400':
          description: If connection id is not valid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectApiResponse'
components:
  schemas:
    AccountInformationPermission:
      enum:
      - ReadAccountsBasic
      - ReadAccountsDetail
      - ReadBalances
      - ReadBeneficiariesBasic
      - ReadBeneficiariesDetail
      - ReadDirectDebits
      - ReadTransactionsBasic
      - ReadTransactionsDetail
      - ReadTransactionsCredits
      - ReadTransactionsDebits
      - ReadStatementsBasic
      - ReadStatementsDetail
      - ReadSupplementaryAccountInfo
      - ReadOffers
      - ReadParty
      - ReadPartyCustomer
      - ReadFutureDatedPaymentsBasic
      - ReadFutureDatedPaymentsDetail
      - ReadPAN
      - ReadPartyPSU
      - ReadPartyPSUIdentity
      - ReadScheduledPaymentsBasic
      - ReadScheduledPaymentsDetail
      - ReadStandingOrdersBasic
      - ReadStandingOrdersDetail
      type: string
    AccountInformationProviderModel:
      required:
      - englishName
      - isEnable
      type: object
      properties:
        id:
          type: string
          format: uuid
        country:
          $ref: '#/components/schemas/CountryResponseModel'
        allowedPermissions:
          type: array
          items:
            $ref: '#/components/schemas/AccountInformationPermission'
          nullable: true
        address:
          type: string
          nullable: true
        phone:
          type: string
          nullable: true
        useBenefit:
          type: boolean
          nullable: true
        arabicName:
          maxLength: 255
          type: string
          nullable: true
        englishName:
          maxLength: 255
          minLength: 1
          type: string
        status:
          $ref: '#/components/schemas/ProviderStatus'
        isEnable:
          type: boolean
        logo:
          maxLength: 255
          type: string
          format: uri
          nullable: true
      additionalProperties: false
    CurrencyResponseModel:
      required:
      - englishName
      - iso4117Code
      type: object
      properties:
        id:
          type: string
          format: uuid
        englishName:
          maxLength: 50
          minLength: 1
          type: string
        arabicName:
          maxLength: 50
          type: string
          nullable: true
        iso4117Code:
          maxLength: 3
          minLength: 1
          type: string
        iso4117Number:
          maxLength: 4
          type: string
          nullable: true
      additionalProperties: false
    ObjectApiResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ApiError'
        errorDescription:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
            nullable: true
          nullable: true
        data:
          nullable: true
      additionalProperties: false
    AccountInformationConnectionResponseModelApiResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ApiError'
        errorDescription:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
            nullable: true
          nullable: true
        data:
          $ref: '#/components/schemas/AccountInformationConnectionResponseModel'
      additionalProperties: false
    ConnectionStatus:
      enum:
      - ACTIVE
      - INACTIVE
      type: string
    PagesModel:
      type: object
      properties:
        currentPageNumber:
          type: integer
          format: int32
        pageSize:
          type: integer
          format: int32
        totalNumberOfPages:
          type: integer
          format: int32
      additionalProperties: false
    AccountInformationConnectionResponseModel:
      type: object
      properties:
        provider:
          $ref: '#/components/schemas/AccountInformationProviderModel'
        id:
          type: string
          format: uuid
        status:
          $ref: '#/components/schemas/ConnectionStatus'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      additionalProperties: false
    ProviderStatus:
      enum:
      - Active
      - Inactive
      type: string
    CountryResponseModel:
      required:
      - englishName
      - iso3166Code
      - timeZone
      type: object
      properties:
        id:
          type: string
          format: uuid
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        currency:
          $ref: '#/components/schemas/CurrencyResponseModel'
        englishName:
          maxLength: 50
          minLength: 1
          type: string
        arabicName:
          maxLength: 50
          type: string
          nullable: true
        iso3166Code:
          maxLength: 2
          minLength: 1
          pattern: ^[A-Z]{2}$
          type: string
        timeZone:
          maxLength: 50
          minLength: 1
          type: string
      additionalProperties: false
    AccountInformationConnectionResponseModelIEnumerablePagesModelMetaApiResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ApiError'
        errorDescription:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
            nullable: true
          nullable: true
        data:
          type: array
          items:
            $ref: '#/components/schemas/AccountInformationConnectionResponseModel'
          nullable: true
        meta:
          $ref: '#/components/schemas/PagesModel'
      additionalProperties: false
    ApiError:
      enum:
      - INVALID_DATA
      - INVALID_SIGNATURE
      - RESOURCE_LOCKED
      - COUNTRY_NOT_FOUND
      - CURRENCY_NOT_FOUND
      - PROVIDER_NOT_FOUND
      - CONNECTION_NOT_FOUND
      - INSUFFICIENT_CONSENT_PERMISSIONS
      - CONSENT_EXPIRED
      - CONSENT_REVOKED
      - CONSENT_UNAUTHORIZED
      - CONSENT_NOT_FOUND
      - RISK_REPORT_NOT_FOUND
      - ACCOUNT_INFORMATION_REPORT_NOT_FOUND
      - MULTIPLE_CURRENCY_NOT_ALLOWED
      - MULTIPLE_CONSENT_DATE_NOT_ALLOWED
      - PAYMENT_NOT_FOUND
      - CONSENT_REJECTED
      - PAYMENT_REQUEST_NOT_FOUND
      - CUSTOMER_NOT_FOUND
      - CUSTOMER_ALREADY_EXISTS
      - BANK_ACCOUNT_NOT_FOUND
      - SERVER_ERROR
      - PROVIDER_CONNECTION_FAILURE
      - TRANSACTION_NOT_FOUND
      - ACCOUNT_INFORMATION_ACCESS_REQUEST_NOT_FOUND
      - CONSENT_REVOCATION_FAILED
      - CONSENT_REVOKED_OR_EXPIRED
      - SUBSCRIPTION_EXPIRED
      - NOT_SUBSCRIBED_TO_SERVICE
      - BENEFICIARY_NOT_FOUND
      - PARTIES_NOT_FOUND
      - DIRECT_DEBIT_NOT_FOUND
      - SCHEDULED_PAYMENT_NOT_FOUND
      - DEBTOR_ACCOUNT_NOT_FOUND
      - CREDITOR_ACCOUNT_NOT_FOUND
      - UNAUTHORIZED_IP_ADDRESS
      type: string
  securitySchemes:
    Bearer:
      type: apiKey
      description: Please enter into field the word 'Bearer' followed by a space and JWT
      name: Authorization
      in: header