Spare Account API

The Account API from Spare — 4 operation(s) for account.

OpenAPI Specification

spare-account-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Information Account 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: Account
paths:
  /api/v1.0/ais/Account/Get:
    get:
      tags:
      - Account
      summary: Get an account by id
      description: "**Unique resource name :** ais.v1.account.get\n            \n**Important!:**\n            \nThe permissions bellow are required on the consent:\n- `ReadAccountsBasic`\n- `ReadAccountsDetail`"
      parameters:
      - name: id
        in: query
        description: Account 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/BankAccountResponseModelApiResponse'
        '400':
          description: '- If account id is not valid'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectApiResponse'
        '404':
          description: '- If an account does not exist'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectApiResponse'
  /api/v1.0/ais/Account/List:
    get:
      tags:
      - Account
      summary: List accounts
      description: "**Unique resource name :** ais.v1.account.list\n            \n**Important!:**\n            \nThe permissions bellow are required on the consent:\n- `ReadAccountsBasic`\n- `ReadAccountsDetail`"
      parameters:
      - name: consentId
        in: query
        description: Consent id
        required: true
        schema:
          type: string
          format: uuid
      - 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 200 per page
        schema:
          type: integer
          format: int32
          default: '20'
      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/BankAccountResponseModelIEnumerablePagesModelMetaApiResponse'
        '400':
          description: '- If consent id is not valid'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectApiResponse'
        '404':
          description: '- If consent does not exists'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectApiResponse'
  /api/v2.0/ais/Account/Get:
    get:
      tags:
      - Account
      summary: Get an account by id for long-lived consent
      description: "**Unique resource name :** ais.v2.account.get\r\n            \r\n**Important!:**\r\n            \r\nThe permissions below are required on the consent:\r\n- `ReadAccountsBasic`\r\n- `ReadAccountsDetail`"
      parameters:
      - name: id
        in: query
        description: Account 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/BankAccountResponseModelApiResponse'
        '400':
          description: '- If account id is not valid'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectApiResponse'
        '404':
          description: '- If an account does not exist'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectApiResponse'
  /api/v2.0/ais/Account/List:
    get:
      tags:
      - Account
      summary: List accounts for long-lived consent
      description: "**Unique resource name :** ais.v2.account.list\r\n            \r\n**Important!:**\r\n            \r\nThe permissions below are required on the consent:\r\n- `ReadAccountsBasic`\r\n- `ReadAccountsDetail`"
      parameters:
      - name: consentId
        in: query
        description: Consent id
        required: true
        schema:
          type: string
          format: uuid
      - 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 200 per page
        schema:
          type: integer
          format: int32
          default: '20'
      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/BankAccountResponseModelIEnumerablePagesModelMetaApiResponse'
        '400':
          description: '- If consent id is not valid'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectApiResponse'
        '404':
          description: '- If consent does not exist'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectApiResponse'
components:
  schemas:
    ServicerResponseModel:
      type: object
      properties:
        id:
          type: string
          format: uuid
        address:
          $ref: '#/components/schemas/ServicerAddressResponseModel'
        scheme:
          type: string
          nullable: true
        identification:
          type: string
          nullable: true
      additionalProperties: false
    PagesModel:
      type: object
      properties:
        currentPageNumber:
          type: integer
          format: int32
        pageSize:
          type: integer
          format: int32
        totalNumberOfPages:
          type: integer
          format: int32
      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
    BankAccountResponseModelIEnumerablePagesModelMetaApiResponse:
      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/BankAccountResponseModel'
          nullable: true
        meta:
          $ref: '#/components/schemas/PagesModel'
      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
    BankAccountResponseModel:
      type: object
      properties:
        id:
          type: string
          format: uuid
        currency:
          $ref: '#/components/schemas/CurrencyResponseModel'
        servicer:
          $ref: '#/components/schemas/ServicerResponseModel'
        accounts:
          type: array
          items:
            $ref: '#/components/schemas/SubAccountsResponseModel'
          nullable: true
        status:
          type: string
          nullable: true
        statusUpdatedDateTime:
          type: string
          format: date-time
          nullable: true
        type:
          type: string
          nullable: true
        subType:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        openingDate:
          type: string
          format: date-time
          nullable: true
        maturityDate:
          type: string
          format: date-time
          nullable: true
      additionalProperties: false
    SubAccountsResponseModel:
      type: object
      properties:
        id:
          type: string
          format: uuid
        scheme:
          type: string
          nullable: true
        identification:
          type: string
          nullable: true
        name:
          type: string
          nullable: true
      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
    BankAccountResponseModelApiResponse:
      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/BankAccountResponseModel'
      additionalProperties: false
    ServicerAddressResponseModel:
      type: object
      properties:
        addressType:
          type: string
          nullable: true
        department:
          type: string
          nullable: true
        subDepartment:
          type: string
          nullable: true
        addressLine:
          type: string
          nullable: true
        streetName:
          type: string
          nullable: true
        buildingNumber:
          type: string
          nullable: true
        postalCode:
          type: string
          nullable: true
        townName:
          type: string
          nullable: true
        countrySubDivision:
          type: string
          nullable: true
        country:
          type: string
          nullable: true
        shortAddress:
          type: string
          nullable: true
        unitNumber:
          type: number
          format: double
          nullable: true
        secondaryNumber:
          type: string
          nullable: true
        district:
          type: string
          nullable: true
        city:
          type: string
          nullable: true
      additionalProperties: false
  securitySchemes:
    Bearer:
      type: apiKey
      description: Please enter into field the word 'Bearer' followed by a space and JWT
      name: Authorization
      in: header