{
  "openapi": "3.0.1",
  "info": {
    "title": "Payment Initiation API",
    "description": "Spare payment initiation 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"
  },
  "paths": {
    "/api/v1.0/pis/Consent/Create": {
      "post": {
        "tags": [
          "Consent"
        ],
        "summary": "Create domestic payment consent",
        "parameters": [
          {
            "name": "x-signature",
            "in": "header",
            "description": "Json web signature (JWS: RFC7519) of the payment initiation consent request payload in detached mode. <see href=\"https://datatracker.ietf.org/doc/html/rfc7519\" />",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Payment initiation consent request model.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DomesticPaymentConsentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomesticPaymentConsentResponseApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "- If model is not valid.\n- If signature is null or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "- If provider does not exist\n- If connection does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after a short wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v1.0/pis/Consent/List": {
      "get": {
        "tags": [
          "Consent"
        ],
        "summary": "List consent",
        "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 100 per page",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": "20"
            }
          },
          {
            "name": "providerId",
            "in": "query",
            "description": "Provider id (Optional)",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "connectionId",
            "in": "query",
            "description": "Connection id (Optional)",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "externalReference",
            "in": "query",
            "description": "External reference (Optional)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomesticPaymentConsentResponsePagedApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "- If connection id is not valid\n- If provider id is not valid\n- If pagination parameters are not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after a short wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v1.0/pis/Consent/Get": {
      "get": {
        "tags": [
          "Consent"
        ],
        "summary": "Get consent by id",
        "parameters": [
          {
            "name": "consentId",
            "in": "query",
            "description": "",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomesticPaymentConsentResponseApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "- If consents id is not valid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "- If consents does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after a short wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v1.0/pis/Payment/List": {
      "post": {
        "tags": [
          "Payment"
        ],
        "summary": "List domestic payment",
        "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 100 per page",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": "20"
            }
          },
          {
            "name": "providerId",
            "in": "query",
            "description": "Provider id (Optional)",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "description": "Payment filter model.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentFilter"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomesticPaymentResponsePagedApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "- If connection id is not valid\n- If provider id is not valid"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after a short wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v1.0/pis/Payment/Get": {
      "get": {
        "tags": [
          "Payment"
        ],
        "summary": "Get domestic payment by id",
        "parameters": [
          {
            "name": "paymentId",
            "in": "query",
            "description": "Payment Id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "consentId",
            "in": "query",
            "description": "Consent Id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomesticPaymentResponseApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "- If payment id is not valid UUID\n- If consent id is not valid UUID\n- If currency does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomesticPaymentResponseApiResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "- If payment does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomesticPaymentResponseApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after a short wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v1.0/pis/Provider/List": {
      "get": {
        "tags": [
          "Provider"
        ],
        "summary": "List open banking providers",
        "parameters": [
          {
            "name": "countryCode",
            "in": "query",
            "description": "Country ISO 3166 alpha-2 code",
            "required": true,
            "schema": {
              "pattern": "^[A-Z]{2}",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentInitiationProviderListApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "- If country code is not a valid ISO 3166 alpha-2 code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentInitiationProviderListApiResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after a short wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v1.0/pis/Request/Create": {
      "post": {
        "tags": [
          "Request"
        ],
        "summary": "Create payment request",
        "parameters": [
          {
            "name": "x-signature",
            "in": "header",
            "description": "Json web signature (JWS: RFC7519) of the payment initiation consent request payload in detached mode. <see href=\"https://datatracker.ietf.org/doc/html/rfc7519\" />",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Payment request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentAccessRequestResponseApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "- If model is not valid.\n- If signature is null or not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "- If provider not found."
          },
          "429": {
            "description": "Too many requests. Retry after a short wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v1.0/pis/Request/List": {
      "get": {
        "tags": [
          "Request"
        ],
        "summary": "List payment requests",
        "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 100 per page",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": "20"
            }
          },
          {
            "name": "externalReference",
            "in": "query",
            "description": "External reference (Optional)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentAccessRequestResponsePagedApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "- If pagination parameters are not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after a short wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v1.0/pis/Request/Get": {
      "get": {
        "tags": [
          "Request"
        ],
        "summary": "Get payment request by id",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentAccessRequestResponseApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "- If payment request id is not valid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "- If payment request does not exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after a short wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v1.0/pis/Request/Delete": {
      "get": {
        "tags": [
          "Request"
        ],
        "summary": "Delete payment request by id",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "- If payment request id is not valid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "423": {
            "description": "- If payment request, has a consent resource created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after a short wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AccountRequest": {
        "required": [
          "identification",
          "scheme"
        ],
        "type": "object",
        "properties": {
          "scheme": {
            "$ref": "#/components/schemas/SchemeName"
          },
          "identification": {
            "minLength": 1,
            "type": "string",
            "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
      },
      "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"
      },
      "ConnectionStatus": {
        "enum": [
          "ACTIVE",
          "INACTIVE"
        ],
        "type": "string"
      },
      "ConsentPaymentType": {
        "enum": [
          "SingleInstantPayment"
        ],
        "type": "string"
      },
      "ConsentScope": {
        "enum": [
          "Accounts",
          "Payments"
        ],
        "type": "string"
      },
      "CountryResponse": {
        "required": [
          "englishName",
          "iso3166Code",
          "timeZone"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Format: UUID.",
            "example": "00000000-0000-0000-0000-000000000000"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "Format: ISO 8601 date-time (e.g. `2025-01-01T00:00:00Z`).",
            "example": "2025-01-01T00:00:00Z"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Format: ISO 8601 date-time (e.g. `2025-01-01T00:00:00Z`).",
            "example": "2025-01-01T00:00:00Z"
          },
          "currency": {
            "$ref": "#/components/schemas/CurrencyResponse",
            "description": "ISO 4217 currency code (e.g. AED, SAR, BHD)."
          },
          "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
      },
      "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
      },
      "DomesticPaymentConsentRequest": {
        "required": [
          "amount",
          "creditorAccount",
          "currency",
          "paymentConsentType",
          "providerId",
          "purpose"
        ],
        "type": "object",
        "properties": {
          "connectionId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Identifier of the account/consent connection. Format: UUID.",
            "example": "00000000-0000-0000-0000-000000000000"
          },
          "providerId": {
            "type": "string",
            "format": "uuid",
            "description": "Identifier of the open banking provider. Format: UUID.",
            "example": "00000000-0000-0000-0000-000000000000"
          },
          "externalReference": {
            "maxLength": 255,
            "type": "string",
            "nullable": true,
            "description": "Your own reference, echoed back for reconciliation."
          },
          "description": {
            "maxLength": 500,
            "type": "string",
            "nullable": true,
            "description": "Free-text description."
          },
          "amount": {
            "minLength": 1,
            "pattern": "^\\d{1,3}(\\.\\d{3})?$",
            "type": "string",
            "description": "Monetary amount as a decimal value."
          },
          "currency": {
            "minLength": 1,
            "pattern": "^[A-Z]{3}",
            "type": "string",
            "description": "ISO 4217 currency code (e.g. AED, SAR, BHD).",
            "example": "BHD"
          },
          "successRedirectUrl": {
            "maxLength": 255,
            "type": "string",
            "format": "uri",
            "nullable": true,
            "description": "URL to redirect the customer to after a successful authorization.",
            "example": "https://example.com"
          },
          "failureRedirectUrl": {
            "maxLength": 255,
            "type": "string",
            "format": "uri",
            "nullable": true,
            "description": "URL to redirect the customer to after a failed or cancelled authorization.",
            "example": "https://example.com"
          },
          "paymentConsentType": {
            "$ref": "#/components/schemas/ConsentPaymentType"
          },
          "purpose": {
            "$ref": "#/components/schemas/PaymentPurpose"
          },
          "note": {
            "type": "string",
            "nullable": true,
            "description": "Optional free-text note."
          },
          "autoRedirect": {
            "type": "boolean",
            "description": "When true, redirect the customer automatically after authorization."
          },
          "debtorAccount": {
            "$ref": "#/components/schemas/AccountRequest"
          },
          "creditorAccount": {
            "$ref": "#/components/schemas/AccountRequest"
          }
        },
        "additionalProperties": false
      },
      "DomesticPaymentConsentResponse": {
        "type": "object",
        "properties": {
          "paymentId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Format: UUID.",
            "example": "00000000-0000-0000-0000-000000000000"
          },
          "consentId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Format: UUID.",
            "example": "00000000-0000-0000-0000-000000000000"
          },
          "externalReference": {
            "type": "string",
            "nullable": true,
            "description": "Your own reference, echoed back for reconciliation."
          },
          "scope": {
            "$ref": "#/components/schemas/ConsentScope"
          },
          "paymentConsentType": {
            "$ref": "#/components/schemas/ConsentPaymentType"
          },
          "executionDateTime": {
            "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"
          },
          "authorizationLink": {
            "type": "string",
            "nullable": true
          },
          "amount": {
            "$ref": "#/components/schemas/PaymentAmountResponse",
            "description": "Monetary amount as a decimal value."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "Format: ISO 8601 date-time (e.g. `2025-01-01T00:00:00Z`).",
            "example": "2025-01-01T00:00:00Z"
          },
          "status": {
            "$ref": "#/components/schemas/ObConsentsStatus"
          },
          "creditorAccount": {
            "$ref": "#/components/schemas/PaymentAccount"
          },
          "debtorAccount": {
            "$ref": "#/components/schemas/PaymentAccount"
          },
          "connection": {
            "$ref": "#/components/schemas/PaymentInitiationConnectionResponse"
          },
          "purpose": {
            "type": "string",
            "nullable": true
          },
          "note": {
            "type": "string",
            "nullable": true,
            "description": "Optional free-text note."
          }
        },
        "additionalProperties": false
      },
      "DomesticPaymentConsentResponseApiResponse": {
        "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/DomesticPaymentConsentResponse"
          }
        },
        "additionalProperties": false
      },
      "DomesticPaymentConsentResponsePagedApiResponse": {
        "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/DomesticPaymentConsentResponse"
            },
            "nullable": true
          },
          "meta": {
            "$ref": "#/components/schemas/Pages"
          }
        },
        "additionalProperties": false
      },
      "DomesticPaymentResponse": {
        "type": "object",
        "properties": {
          "paymentId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Format: UUID.",
            "example": "00000000-0000-0000-0000-000000000000"
          },
          "reference": {
            "type": "string",
            "nullable": true
          },
          "paymentRequestType": {
            "type": "string",
            "nullable": true
          },
          "externalReference": {
            "type": "string",
            "nullable": true,
            "description": "Your own reference, echoed back for reconciliation."
          },
          "description": {
            "type": "string",
            "nullable": true,
            "description": "Free-text description."
          },
          "amount": {
            "$ref": "#/components/schemas/PaymentAmountResponse",
            "description": "Monetary amount as a decimal value."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "Format: ISO 8601 date-time (e.g. `2025-01-01T00:00:00Z`).",
            "example": "2025-01-01T00:00:00Z"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Format: ISO 8601 date-time (e.g. `2025-01-01T00:00:00Z`).",
            "example": "2025-01-01T00:00:00Z"
          },
          "status": {
            "$ref": "#/components/schemas/PaymentTransactionStatus"
          },
          "purpose": {
            "type": "string",
            "nullable": true
          },
          "note": {
            "type": "string",
            "nullable": true,
            "description": "Optional free-text note."
          },
          "creditorAccount": {
            "$ref": "#/components/schemas/PaymentAccount"
          },
          "debtorAccount": {
            "$ref": "#/components/schemas/PaymentAccount"
          },
          "consent": {
            "$ref": "#/components/schemas/PaymentInitiationConsentResponse"
          }
        },
        "additionalProperties": false
      },
      "DomesticPaymentResponseApiResponse": {
        "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/DomesticPaymentResponse"
          }
        },
        "additionalProperties": false
      },
      "DomesticPaymentResponsePagedApiResponse": {
        "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/DomesticPaymentResponse"
            },
            "nullable": true
          },
          "meta": {
            "$ref": "#/components/schemas/Pages"
          }
        },
        "additionalProperties": false
      },
      "FilterOrder": {
        "enum": [
          "ASCENDING",
          "DESCENDING"
        ],
        "type": "string"
      },
      "ObConsentsStatus": {
        "enum": [
          "AwaitingAuthorization",
          "Authorized",
          "Authorised",
          "Consumed",
          "Rejected",
          "Expired",
          "Revoked"
        ],
        "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"
          }
        },
        "additionalProperties": false
      },
      "PaymentAccessRequestResponse": {
        "required": [
          "type"
        ],
        "type": "object",
        "properties": {
          "paymentRequestId": {
            "type": "string",
            "format": "uuid",
            "description": "Format: UUID.",
            "example": "00000000-0000-0000-0000-000000000000"
          },
          "status": {
            "$ref": "#/components/schemas/RequestStatus"
          },
          "amount": {
            "$ref": "#/components/schemas/PaymentAmountResponse",
            "description": "Monetary amount as a decimal value."
          },
          "consent": {
            "$ref": "#/components/schemas/PaymentInitiationConsentResponse"
          },
          "country": {
            "$ref": "#/components/schemas/CountryResponse"
          },
          "debtorAccount": {
            "$ref": "#/components/schemas/PaymentAccountResponse"
          },
          "creditorAccount": {
            "$ref": "#/components/schemas/PaymentAccountResponse"
          },
          "hashId": {
            "type": "string",
            "nullable": true
          },
          "purpose": {
            "type": "string",
            "nullable": true
          },
          "note": {
            "type": "string",
            "nullable": true,
            "description": "Optional free-text note."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "Format: ISO 8601 date-time (e.g. `2025-01-01T00:00:00Z`).",
            "example": "2025-01-01T00:00:00Z"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Format: ISO 8601 date-time (e.g. `2025-01-01T00:00:00Z`).",
            "example": "2025-01-01T00:00:00Z"
          },
          "requestLink": {
            "type": "string",
            "nullable": true
          },
          "paymentConsentType": {
            "$ref": "#/components/schemas/ConsentPaymentType"
          },
          "executionDateTime": {
            "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": {
            "$ref": "#/components/schemas/PaymentType"
          },
          "description": {
            "maxLength": 500,
            "type": "string",
            "nullable": true,
            "description": "Free-text description."
          },
          "externalReference": {
            "maxLength": 255,
            "type": "string",
            "nullable": true,
            "description": "Your own reference, echoed back for reconciliation."
          },
          "redirectionFlow": {
            "$ref": "#/components/schemas/RedirectionFlow"
          },
          "successRedirectUrl": {
            "maxLength": 255,
            "type": "string",
            "format": "uri",
            "nullable": true,
            "description": "URL to redirect the customer to after a successful authorization.",
            "example": "https://example.com"
          },
          "failureRedirectUrl": {
            "maxLength": 255,
            "type": "string",
            "format": "uri",
            "nullable": true,
            "description": "URL to redirect the customer to after a failed or cancelled authorization.",
            "example": "https://example.com"
          },
          "autoRedirect": {
            "type": "boolean",
            "description": "When true, redirect the customer automatically after authorization."
          }
        },
        "additionalProperties": false
      },
      "PaymentAccessRequestResponseApiResponse": {
        "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/PaymentAccessRequestResponse"
          }
        },
        "additionalProperties": false
      },
      "PaymentAccessRequestResponsePagedApiResponse": {
        "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/PaymentAccessRequestResponse"
            },
            "nullable": true
          },
          "meta": {
            "$ref": "#/components/schemas/Pages"
          }
        },
        "additionalProperties": false
      },
      "PaymentAccount": {
        "required": [
          "identification",
          "scheme"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Format: UUID.",
            "example": "00000000-0000-0000-0000-000000000000"
          },
          "scheme": {
            "$ref": "#/components/schemas/SchemeName"
          },
          "identification": {
            "minLength": 1,
            "type": "string",
            "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
      },
      "PaymentAccountResponse": {
        "required": [
          "identification",
          "scheme"
        ],
        "type": "object",
        "properties": {
          "provider": {
            "$ref": "#/components/schemas/PaymentInitiationProvider"
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Format: UUID.",
            "example": "00000000-0000-0000-0000-000000000000"
          },
          "scheme": {
            "$ref": "#/components/schemas/SchemeName"
          },
          "identification": {
            "minLength": 1,
            "type": "string",
            "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
      },
      "PaymentAmountResponse": {
        "type": "object",
        "properties": {
          "value": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "currency": {
            "$ref": "#/components/schemas/CurrencyResponse",
            "description": "ISO 4217 currency code (e.g. AED, SAR, BHD)."
          }
        },
        "additionalProperties": false
      },
      "PaymentFilter": {
        "type": "object",
        "properties": {
          "fromDateTime": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Start of the date-time range (ISO 8601).",
            "example": "2025-01-01T00:00:00Z"
          },
          "toDateTime": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "End of the date-time range (ISO 8601).",
            "example": "2025-01-01T00:00:00Z"
          },
          "status": {
            "$ref": "#/components/schemas/PaymentTransactionStatus"
          },
          "amount": {
            "type": "number",
            "format": "double",
            "nullable": true,
            "description": "Monetary amount as a decimal value."
          },
          "accountName": {
            "type": "string",
            "nullable": true,
            "description": "Name of the account."
          },
          "paymentType": {
            "$ref": "#/components/schemas/ObTransactionType"
          },
          "order": {
            "$ref": "#/components/schemas/FilterOrder"
          }
        },
        "additionalProperties": false
      },
      "PaymentInitiationConnectionResponse": {
        "type": "object",
        "properties": {
          "provider": {
            "$ref": "#/components/schemas/PaymentInitiationProvider"
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Format: UUID.",
            "example": "00000000-0000-0000-0000-000000000000"
          },
          "status": {
            "$ref": "#/components/schemas/ConnectionStatus"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "Format: ISO 8601 date-time (e.g. `2025-01-01T00:00:00Z`).",
            "example": "2025-01-01T00:00:00Z"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Format: ISO 8601 date-time (e.g. `2025-01-01T00:00:00Z`).",
            "example": "2025-01-01T00:00:00Z"
          }
        },
        "additionalProperties": false
      },
      "PaymentInitiationConsentResponse": {
        "type": "object",
        "properties": {
          "connection": {
            "$ref": "#/components/schemas/PaymentInitiationConnectionResponse"
          },
          "paymentConsentType": {
            "$ref": "#/components/schemas/ConsentPaymentType"
          },
          "executionDateTime": {
            "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"
          },
          "purpose": {
            "type": "string",
            "nullable": true
          },
          "note": {
            "type": "string",
            "nullable": true,
            "description": "Optional free-text note."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Format: UUID.",
            "example": "00000000-0000-0000-0000-000000000000"
          },
          "customerId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Identifier of the customer. Format: UUID.",
            "example": "00000000-0000-0000-0000-000000000000"
          },
          "scope": {
            "$ref": "#/components/schemas/ConsentScope"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "Format: ISO 8601 date-time (e.g. `2025-01-01T00:00:00Z`).",
            "example": "2025-01-01T00:00:00Z"
          },
          "status": {
            "$ref": "#/components/schemas/ObConsentsStatus"
          },
          "authorizationLink": {
            "type": "string",
            "nullable": true
          },
          "successRedirectUrl": {
            "type": "string",
            "nullable": true,
            "description": "URL to redirect the customer to after a successful authorization."
          },
          "failureRedirectUrl": {
            "type": "string",
            "nullable": true,
            "description": "URL to redirect the customer to after a failed or cancelled authorization."
          }
        },
        "additionalProperties": false
      },
      "PaymentInitiationProvider": {
        "required": [
          "englishName"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Format: UUID.",
            "example": "00000000-0000-0000-0000-000000000000"
          },
          "country": {
            "$ref": "#/components/schemas/CountryResponse"
          },
          "address": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true,
            "description": "Phone number."
          },
          "isEnable": {
            "type": "boolean"
          },
          "arabicName": {
            "maxLength": 255,
            "type": "string",
            "nullable": true
          },
          "englishName": {
            "maxLength": 255,
            "minLength": 1,
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/ProviderStatus"
          },
          "logo": {
            "maxLength": 255,
            "type": "string",
            "format": "uri",
            "nullable": true,
            "description": "Format: URL.",
            "example": "https://example.com"
          }
        },
        "additionalProperties": false
      },
      "PaymentInitiationProviderListApiResponse": {
        "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/PaymentInitiationProvider"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PaymentPurpose": {
        "enum": [
          "SELF",
          "ONLP",
          "LORP",
          "BIL",
          "DONA",
          "DUES",
          "GOPT",
          "PERS",
          "PERL"
        ],
        "type": "string"
      },
      "PaymentRequest": {
        "required": [
          "amount",
          "countryCode",
          "creditorAccount",
          "currency",
          "paymentConsentType",
          "purpose",
          "type"
        ],
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/PaymentType"
          },
          "description": {
            "maxLength": 500,
            "type": "string",
            "nullable": true,
            "description": "Free-text description."
          },
          "externalReference": {
            "maxLength": 255,
            "type": "string",
            "nullable": true,
            "description": "Your own reference, echoed back for reconciliation."
          },
          "redirectionFlow": {
            "$ref": "#/components/schemas/RedirectionFlow"
          },
          "successRedirectUrl": {
            "maxLength": 255,
            "type": "string",
            "format": "uri",
            "nullable": true,
            "description": "URL to redirect the customer to after a successful authorization.",
            "example": "https://example.com"
          },
          "failureRedirectUrl": {
            "maxLength": 255,
            "type": "string",
            "format": "uri",
            "nullable": true,
            "description": "URL to redirect the customer to after a failed or cancelled authorization.",
            "example": "https://example.com"
          },
          "autoRedirect": {
            "type": "boolean",
            "nullable": true,
            "description": "When true, redirect the customer automatically after authorization."
          },
          "debtorAccount": {
            "$ref": "#/components/schemas/AccountRequest"
          },
          "creditorAccount": {
            "$ref": "#/components/schemas/AccountRequest"
          },
          "amount": {
            "minLength": 1,
            "pattern": "^\\d{1,3}(\\.\\d{3})?$",
            "type": "string",
            "description": "Monetary amount as a decimal value."
          },
          "currency": {
            "minLength": 1,
            "pattern": "^[A-Z]{3}",
            "type": "string",
            "description": "ISO 4217 currency code (e.g. AED, SAR, BHD).",
            "example": "BHD"
          },
          "providerId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Identifier of the open banking provider. Format: UUID.",
            "example": "00000000-0000-0000-0000-000000000000"
          },
          "countryCode": {
            "minLength": 1,
            "pattern": "^[A-Z]{2}",
            "type": "string",
            "description": "ISO 3166 alpha-2 country code (e.g. AE, SA, BH).",
            "example": "BH"
          },
          "paymentConsentType": {
            "$ref": "#/components/schemas/ConsentPaymentType"
          },
          "purpose": {
            "$ref": "#/components/schemas/PaymentPurpose"
          },
          "note": {
            "type": "string",
            "nullable": true,
            "description": "Optional free-text note."
          }
        },
        "additionalProperties": false
      },
      "PaymentTransactionStatus": {
        "enum": [
          "CREATED",
          "ACCEPTED",
          "CANCELLED",
          "PENDING",
          "RECEIVED",
          "REJECTED",
          "COMPLETED"
        ],
        "type": "string"
      },
      "PaymentType": {
        "enum": [
          "SINGLE_DOMESTIC",
          "RECURRENT"
        ],
        "type": "string"
      },
      "ProviderStatus": {
        "enum": [
          "Active",
          "Inactive"
        ],
        "type": "string"
      },
      "RedirectionFlow": {
        "enum": [
          "WEB",
          "DECOUPLED"
        ],
        "type": "string"
      },
      "RequestStatus": {
        "enum": [
          "AwaitingApproval",
          "Rejected",
          "Approved",
          "Expired"
        ],
        "type": "string"
      },
      "SchemeName": {
        "enum": [
          "IBAN",
          "BBAN"
        ],
        "type": "string"
      }
    },
    "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.tryspare.com",
      "description": "Sandbox"
    }
  ]
}
