{
  "openapi": "3.0.1",
  "info": {
    "title": "Account Information API",
    "description": "Spare account information API documentation",
    "termsOfService": "https://terms.tryspare.com/en",
    "contact": {
      "name": "Spare Arabian Financial Co.",
      "email": "hello@tryspare.com"
    },
    "license": {
      "name": "Spare Arabian Financial Co."
    },
    "version": "2.0"
  },
  "paths": {
    "/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": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BankAccountResponseApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "- If account id is not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "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"
                }
              }
            }
          },
          "404": {
            "description": "- If an account does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/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": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BankAccountResponsePagedApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "- If consent id is not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "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"
                }
              }
            }
          },
          "404": {
            "description": "- If consent does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2.0/ais/Balance/Get": {
      "get": {
        "tags": [
          "Balance"
        ],
        "summary": "Get account balance for long-lived consent",
        "description": "**Unique resource name :** ais.v2.balance.get\r\n            \r\n**Important!:**\r\n            \r\nThe permissions below are required on the consent:\r\n- `ReadAccountsBasic`\r\n- `ReadAccountsDetail`\r\n- `ReadBalances`",
        "parameters": [
          {
            "name": "accountId",
            "in": "query",
            "description": "Account id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountBalanceApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "- If account id is not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "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"
                }
              }
            }
          },
          "404": {
            "description": "- If an account does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2.0/ais/Transaction/Get": {
      "get": {
        "tags": [
          "Transaction"
        ],
        "summary": "Get transaction details for long-lived consent",
        "description": "**Unique resource name :** ais.v2.transaction.get\r\n            \r\n**Important!:**\r\n            \r\nThe permissions below are required on the consent:\r\n- `ReadTransactionsBasic`\r\n- `ReadTransactionsDetail`\r\n- `ReadTransactionsDebits`\r\n- `ReadTransactionsCredits`",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "Transaction id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionDetailsResponseApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "- If transaction id is not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "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"
                }
              }
            }
          },
          "404": {
            "description": "- If transaction does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2.0/ais/Transaction/List": {
      "post": {
        "tags": [
          "Transaction"
        ],
        "summary": "List transactions for long-lived consent",
        "description": "**Unique resource name :** ais.v2.transaction.list\r\n            \r\n**Important!:**\r\n            \r\nThe permissions below are required on the consent:\r\n- ReadTransactionsBasic\r\n- ReadTransactionsDetail\r\n- ReadTransactionsDebits\r\n- ReadTransactionsCredits",
        "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"
            }
          },
          {
            "name": "accountId",
            "in": "query",
            "description": "Bank account id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "description": "Filter model",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransactionFilter"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionResponsePagedApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "- If consent id is not valid\r\n- If a filter model is not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "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"
                }
              }
            }
          },
          "404": {
            "description": "- If consent does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AccountBalance": {
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string",
            "format": "uuid",
            "description": "Format: UUID.",
            "example": "00000000-0000-0000-0000-000000000000"
          },
          "externalAccountId": {
            "type": "string",
            "nullable": true
          },
          "balances": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Balance"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "AccountBalanceApiResponse": {
        "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/AccountBalance"
          }
        },
        "additionalProperties": false
      },
      "AmountResponse": {
        "type": "object",
        "properties": {
          "currency": {
            "$ref": "#/components/schemas/CurrencyResponse",
            "description": "ISO 4217 currency code (e.g. AED, SAR, BHD)."
          },
          "amount": {
            "type": "number",
            "format": "double",
            "nullable": true,
            "description": "Monetary amount as a decimal value."
          },
          "chargeIncluded": {
            "type": "boolean",
            "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",
          "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",
          "REAL_ESTATE_VERIFY_NOT_FOUND",
          "REAL_ESTATE_VALIDATE_NOT_FOUND",
          "REAL_ESTATE_SEARCH_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",
          "REAL_ESTATE_FAILED"
        ],
        "type": "string"
      },
      "BalanceAmount": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "format": "double",
            "description": "Monetary amount as a decimal value."
          },
          "currency": {
            "type": "string",
            "nullable": true,
            "description": "ISO 4217 currency code (e.g. AED, SAR, BHD).",
            "example": "SAR"
          },
          "localExchange": {
            "$ref": "#/components/schemas/BalanceLocalExchange"
          }
        },
        "additionalProperties": false
      },
      "BalanceDataCreditLine": {
        "type": "object",
        "properties": {
          "included": {
            "type": "boolean",
            "nullable": true
          },
          "type": {
            "type": "string",
            "nullable": true
          },
          "amount": {
            "$ref": "#/components/schemas/BalanceAmount",
            "description": "Monetary amount as a decimal value."
          }
        },
        "additionalProperties": false
      },
      "BalanceLocalExchange": {
        "type": "object",
        "properties": {
          "sourceCurrency": {
            "type": "string",
            "nullable": true,
            "example": "SAR"
          },
          "targetCurrency": {
            "type": "string",
            "nullable": true,
            "example": "SAR"
          },
          "rate": {
            "type": "number",
            "format": "double"
          },
          "date": {
            "type": "string",
            "format": "date",
            "description": "Format: ISO 8601 date (e.g. `2025-01-01`).",
            "example": "2025-01-01"
          },
          "value": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "Balance": {
        "type": "object",
        "properties": {
          "creditDebitIndicator": {
            "type": "string",
            "nullable": true
          },
          "dateTime": {
            "type": "string",
            "nullable": true,
            "format": "date-time",
            "description": "Format: ISO 8601 date-time (e.g. `2025-01-01T00:00:00Z`).",
            "example": "2025-01-01T00:00:00Z"
          },
          "creditLine": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BalanceDataCreditLine"
            },
            "nullable": true
          },
          "type": {
            "type": "string",
            "nullable": true
          },
          "amount": {
            "$ref": "#/components/schemas/BalanceAmount",
            "description": "Monetary amount as a decimal value."
          }
        },
        "additionalProperties": false
      },
      "BankAccountResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Format: UUID.",
            "example": "00000000-0000-0000-0000-000000000000"
          },
          "externalId": {
            "type": "string",
            "nullable": true,
            "description": "Your external identifier for the resource."
          },
          "currency": {
            "$ref": "#/components/schemas/CurrencyResponse",
            "description": "ISO 4217 currency code (e.g. AED, SAR, BHD)."
          },
          "servicer": {
            "$ref": "#/components/schemas/ServicerResponse"
          },
          "accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SubAccountsResponse"
            },
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "statusUpdatedDateTime": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Format: ISO 8601 date-time (e.g. `2025-01-01T00:00:00Z`).",
            "example": "2025-01-01T00:00:00Z"
          },
          "type": {
            "type": "string",
            "nullable": true
          },
          "subType": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true,
            "description": "Free-text description."
          },
          "openingDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Format: ISO 8601 date-time (e.g. `2025-01-01T00:00:00Z`).",
            "example": "2025-01-01T00:00:00Z"
          },
          "maturityDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Format: ISO 8601 date-time (e.g. `2025-01-01T00:00:00Z`).",
            "example": "2025-01-01T00:00:00Z"
          }
        },
        "additionalProperties": false
      },
      "BankAccountResponseApiResponse": {
        "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/BankAccountResponse"
          }
        },
        "additionalProperties": false
      },
      "BankAccountResponsePagedApiResponse": {
        "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/BankAccountResponse"
            },
            "nullable": true
          },
          "meta": {
            "$ref": "#/components/schemas/Pages"
          }
        },
        "additionalProperties": false
      },
      "BillDetails": {
        "type": "object",
        "properties": {
          "billerId": {
            "type": "string",
            "nullable": true
          },
          "billNumber": {
            "type": "string",
            "nullable": true
          },
          "billPaymentType": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CurrencyResponse": {
        "required": [
          "englishName",
          "iso4117Code"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Format: UUID.",
            "example": "00000000-0000-0000-0000-000000000000"
          },
          "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
      },
      "FilterOrder": {
        "enum": [
          "ASCENDING",
          "DESCENDING"
        ],
        "type": "string"
      },
      "ObTransactionProperty": {
        "enum": [
          "BOOKING_DATE",
          "STATUS",
          "TYPE",
          "MERCHANT_NAME",
          "MERCHANT_CATEGORY_CODE"
        ],
        "type": "string"
      },
      "ObTransactionStatus": {
        "enum": [
          "BOOKED",
          "PENDING",
          "REJECTED"
        ],
        "type": "string"
      },
      "ObTransactionType": {
        "enum": [
          "CREDIT",
          "DEBIT"
        ],
        "type": "string"
      },
      "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
      },
      "Pages": {
        "type": "object",
        "properties": {
          "currentPageNumber": {
            "type": "integer",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "totalNumberOfPages": {
            "type": "integer",
            "format": "int32"
          },
          "totalItems": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "ServicerAddress": {
        "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
          },
          "countryName": {
            "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
          },
          "country": {
            "type": "string",
            "nullable": true,
            "example": "SA"
          }
        },
        "additionalProperties": false
      },
      "ServicerAddressResponse": {
        "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,
            "example": "SA"
          },
          "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
      },
      "Servicer": {
        "type": "object",
        "properties": {
          "scheme": {
            "type": "string",
            "nullable": true
          },
          "identification": {
            "type": "string",
            "nullable": true,
            "description": "Account identifier, its format is given by the accompanying scheme (e.g. an IBAN)."
          },
          "address": {
            "$ref": "#/components/schemas/ServicerAddress"
          }
        },
        "additionalProperties": false
      },
      "ServicerResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Format: UUID.",
            "example": "00000000-0000-0000-0000-000000000000"
          },
          "address": {
            "$ref": "#/components/schemas/ServicerAddressResponse"
          },
          "scheme": {
            "type": "string",
            "nullable": true
          },
          "identification": {
            "type": "string",
            "nullable": true,
            "description": "Account identifier, its format is given by the accompanying scheme (e.g. an IBAN)."
          }
        },
        "additionalProperties": false
      },
      "SubAccountsResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Format: UUID.",
            "example": "00000000-0000-0000-0000-000000000000"
          },
          "scheme": {
            "type": "string",
            "nullable": true
          },
          "identification": {
            "type": "string",
            "nullable": true,
            "description": "Account identifier, its format is given by the accompanying scheme (e.g. an IBAN)."
          },
          "name": {
            "type": "string",
            "nullable": true,
            "description": "Name associated with this object."
          }
        },
        "additionalProperties": false
      },
      "TransactionAmountResponse": {
        "type": "object",
        "properties": {
          "currency": {
            "$ref": "#/components/schemas/CurrencyResponse",
            "description": "ISO 4217 currency code (e.g. AED, SAR, BHD)."
          },
          "localExchange": {
            "$ref": "#/components/schemas/BalanceLocalExchange"
          },
          "amount": {
            "type": "number",
            "format": "double",
            "nullable": true,
            "description": "Monetary amount as a decimal value."
          },
          "chargeIncluded": {
            "type": "boolean",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TransactionBalance": {
        "type": "object",
        "properties": {
          "currency": {
            "$ref": "#/components/schemas/CurrencyResponse",
            "description": "ISO 4217 currency code (e.g. AED, SAR, BHD)."
          },
          "creditDebitIndicator": {
            "type": "string",
            "nullable": true
          },
          "type": {
            "type": "string",
            "nullable": true
          },
          "amount": {
            "type": "number",
            "format": "double",
            "nullable": true,
            "description": "Monetary amount as a decimal value."
          },
          "chargeIncluded": {
            "type": "boolean",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TransactionBankCode": {
        "type": "object",
        "properties": {
          "subCode": {
            "type": "string",
            "nullable": true
          },
          "domain": {
            "type": "string",
            "nullable": true
          },
          "domainCode": {
            "type": "string",
            "nullable": true
          },
          "family": {
            "type": "string",
            "nullable": true
          },
          "familyCode": {
            "type": "string",
            "nullable": true
          },
          "subFamily": {
            "type": "string",
            "nullable": true
          },
          "subFamilyCode": {
            "type": "string",
            "nullable": true
          },
          "code": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TransactionCurrencyExchangeResponse": {
        "type": "object",
        "properties": {
          "sourceCurrency": {
            "$ref": "#/components/schemas/CurrencyResponse"
          },
          "targetCurrency": {
            "$ref": "#/components/schemas/CurrencyResponse"
          },
          "exchangeRate": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "unitCurrency": {
            "$ref": "#/components/schemas/CurrencyResponse"
          },
          "contractIdentification": {
            "type": "string",
            "nullable": true
          },
          "quotationDate": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Format: ISO 8601 date (e.g. `2025-01-01`).",
            "example": "2025-01-01"
          },
          "instructedAmount": {
            "$ref": "#/components/schemas/AmountResponse"
          }
        },
        "additionalProperties": false
      },
      "TransactionDetailsResponse": {
        "type": "object",
        "properties": {
          "account": {
            "$ref": "#/components/schemas/BankAccountResponse"
          },
          "balance": {
            "$ref": "#/components/schemas/TransactionBalance"
          },
          "creditorAgent": {
            "$ref": "#/components/schemas/Servicer"
          },
          "debtorAgent": {
            "$ref": "#/components/schemas/Servicer"
          },
          "deborAccount": {
            "$ref": "#/components/schemas/SubAccountsResponse"
          },
          "creditorAccount": {
            "$ref": "#/components/schemas/SubAccountsResponse"
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Format: UUID.",
            "example": "00000000-0000-0000-0000-000000000000"
          },
          "externalTransactionId": {
            "type": "string",
            "nullable": true
          },
          "externalAccountId": {
            "type": "string",
            "nullable": true
          },
          "transactionReference": {
            "type": "string",
            "nullable": true
          },
          "localTimeZone": {
            "type": "string",
            "nullable": true
          },
          "transactionDateTime": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Format: ISO 8601 date-time (e.g. `2025-01-01T00:00:00Z`).",
            "example": "2025-01-01T00:00:00Z"
          },
          "subTransactionType": {
            "type": "string",
            "nullable": true
          },
          "transactionType": {
            "type": "string",
            "nullable": true
          },
          "flags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "paymentModes": {
            "type": "string",
            "nullable": true
          },
          "transactionMutability": {
            "type": "string",
            "nullable": true
          },
          "transactionInformation": {
            "type": "string",
            "nullable": true
          },
          "statementReference": {
            "type": "string",
            "nullable": true
          },
          "creditDebitIndicator": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "bookingDateTime": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Format: ISO 8601 date (e.g. `2025-01-01`).",
            "example": "2025-01-01"
          },
          "valueDateTime": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Format: ISO 8601 date (e.g. `2025-01-01`).",
            "example": "2025-01-01"
          },
          "addressLine": {
            "type": "string",
            "nullable": true
          },
          "amount": {
            "$ref": "#/components/schemas/TransactionAmountResponse",
            "description": "Monetary amount as a decimal value."
          },
          "chargeAmount": {
            "$ref": "#/components/schemas/AmountResponse"
          },
          "billDetails": {
            "$ref": "#/components/schemas/BillDetails"
          },
          "currencyExchange": {
            "$ref": "#/components/schemas/TransactionCurrencyExchangeResponse"
          },
          "bankTransactionCode": {
            "$ref": "#/components/schemas/TransactionBankCode"
          },
          "proprietaryBankTransactionCode": {
            "$ref": "#/components/schemas/TransactionProprietaryBankTransactionCode"
          },
          "merchantDetails": {
            "$ref": "#/components/schemas/TransactionMerchantDetails"
          },
          "subCategoryName": {
            "type": "string",
            "nullable": true
          },
          "categoryCode": {
            "type": "string",
            "nullable": true
          },
          "categoryName": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TransactionDetailsResponseApiResponse": {
        "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/TransactionDetailsResponse"
          }
        },
        "additionalProperties": false
      },
      "TransactionFilter": {
        "type": "object",
        "properties": {
          "fromBookingDateTime": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Start of the booking date-time range (ISO 8601).",
            "example": "2025-01-01T00:00:00Z"
          },
          "toBookingDateTime": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "End of the booking date-time range (ISO 8601).",
            "example": "2025-01-01T00:00:00Z"
          },
          "status": {
            "$ref": "#/components/schemas/ObTransactionStatus"
          },
          "type": {
            "$ref": "#/components/schemas/ObTransactionType"
          },
          "searchBy": {
            "$ref": "#/components/schemas/ObTransactionProperty"
          },
          "searchKeyWord": {
            "maxLength": 100,
            "type": "string",
            "nullable": true,
            "description": "Keyword to filter results by."
          },
          "orderBy": {
            "$ref": "#/components/schemas/ObTransactionProperty"
          },
          "order": {
            "$ref": "#/components/schemas/FilterOrder"
          }
        },
        "additionalProperties": false
      },
      "TransactionMerchantDetails": {
        "type": "object",
        "properties": {
          "categoryCode": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true,
            "description": "Name associated with this object."
          },
          "merchantId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TransactionProprietaryBankTransactionCode": {
        "type": "object",
        "properties": {
          "issuer": {
            "type": "string",
            "nullable": true
          },
          "code": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TransactionResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Format: UUID.",
            "example": "00000000-0000-0000-0000-000000000000"
          },
          "externalTransactionId": {
            "type": "string",
            "nullable": true
          },
          "externalAccountId": {
            "type": "string",
            "nullable": true
          },
          "transactionReference": {
            "type": "string",
            "nullable": true
          },
          "localTimeZone": {
            "type": "string",
            "nullable": true
          },
          "transactionDateTime": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Format: ISO 8601 date-time (e.g. `2025-01-01T00:00:00Z`).",
            "example": "2025-01-01T00:00:00Z"
          },
          "subTransactionType": {
            "type": "string",
            "nullable": true
          },
          "transactionType": {
            "type": "string",
            "nullable": true
          },
          "flags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "paymentModes": {
            "type": "string",
            "nullable": true
          },
          "transactionMutability": {
            "type": "string",
            "nullable": true
          },
          "transactionInformation": {
            "type": "string",
            "nullable": true
          },
          "statementReference": {
            "type": "string",
            "nullable": true
          },
          "creditDebitIndicator": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "bookingDateTime": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Format: ISO 8601 date (e.g. `2025-01-01`).",
            "example": "2025-01-01"
          },
          "valueDateTime": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Format: ISO 8601 date (e.g. `2025-01-01`).",
            "example": "2025-01-01"
          },
          "addressLine": {
            "type": "string",
            "nullable": true
          },
          "amount": {
            "$ref": "#/components/schemas/TransactionAmountResponse",
            "description": "Monetary amount as a decimal value."
          },
          "chargeAmount": {
            "$ref": "#/components/schemas/AmountResponse"
          },
          "billDetails": {
            "$ref": "#/components/schemas/BillDetails"
          },
          "currencyExchange": {
            "$ref": "#/components/schemas/TransactionCurrencyExchangeResponse"
          },
          "bankTransactionCode": {
            "$ref": "#/components/schemas/TransactionBankCode"
          },
          "proprietaryBankTransactionCode": {
            "$ref": "#/components/schemas/TransactionProprietaryBankTransactionCode"
          },
          "merchantDetails": {
            "$ref": "#/components/schemas/TransactionMerchantDetails"
          },
          "subCategoryName": {
            "type": "string",
            "nullable": true
          },
          "categoryCode": {
            "type": "string",
            "nullable": true
          },
          "categoryName": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TransactionResponsePagedApiResponse": {
        "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/TransactionResponse"
            },
            "nullable": true
          },
          "meta": {
            "$ref": "#/components/schemas/Pages"
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "Bearer": {
        "type": "apiKey",
        "description": "Please enter into field the word 'Bearer' followed by a space and JWT",
        "name": "Authorization",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "Bearer": []
    }
  ],
  "servers": [
    {
      "url": "https://sandbox.sparefinancial.sa",
      "description": "Sandbox"
    }
  ]
}
