Statement Service API

OpenAPI

Скачать исходную спецификацию

Варианты

  • Паблик

Операции API

POST /statements/report/query — Download statements in PDF format

This method is deprecated. Use the [new `/bank-statements/v1/reports/pdf`](https://developer.raif.ru/docs/api/bank-statements/pdf-request) instead.

{
  "tags": [
    "StatementsDownload"
  ],
  "summary": "Download statements in PDF format",
  "description": "This method is deprecated. Use the [new `/bank-statements/v1/reports/pdf`](https://developer.raif.ru/docs/api/bank-statements/pdf-request) instead.\n",
  "operationId": "downloadStatementsPdf",
  "parameters": [
    {
      "$ref": "#/components/parameters/IdTokenHeader"
    }
  ],
  "requestBody": {
    "required": true,
    "description": "Parameters for generating a file with statements",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/StatementsDownloadPdfRequest"
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "File with statements was successfully downloaded",
      "headers": {
        "Content-Disposition": {
          "$ref": "#/components/headers/Content-Disposition"
        },
        "X-Rate-Limit-Limit": {
          "$ref": "#/components/headers/X-Rate-Limit-Limit"
        },
        "X-Rate-Limit-Remaining": {
          "$ref": "#/components/headers/X-Rate-Limit-Remaining"
        },
        "X-Rate-Limit-Reset": {
          "$ref": "#/components/headers/X-Rate-Limit-Reset"
        }
      },
      "content": {
        "application/pdf": {
          "schema": {
            "description": "File with statements in PDF format (separate=false)",
            "example": "<byte array>"
          }
        },
        "application/zip": {
          "schema": {
            "description": "ZIP archive with extract files in PDF format (separate=true)",
            "example": "<byte array>"
          }
        }
      }
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "404": {
      "description": "No statements were found for the specified keys"
    },
    "429": {
      "$ref": "#/components/responses/RateLimit"
    }
  }
}

POST /v2.0/statements/excel-interval/query — Download statements in Excel format

Этот метод устарел. Используйте [новую версию `/bank-statements/v1/reports/excel`](https://developer.raif.ru/docs/api/bank-statements/excel-request).

{
  "tags": [
    "StatementsDownload"
  ],
  "summary": "Download statements in Excel format",
  "description": "Этот метод устарел. Используйте [новую версию `/bank-statements/v1/reports/excel`](https://developer.raif.ru/docs/api/bank-statements/excel-request).\n",
  "operationId": "downloadStatementsExcel",
  "parameters": [
    {
      "$ref": "#/components/parameters/IdTokenHeader"
    }
  ],
  "requestBody": {
    "required": true,
    "description": "Parameters for generating a file with statements",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/StatementsDownloadExcelRequest"
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "File with statements was successfully downloaded",
      "headers": {
        "Content-Disposition": {
          "description": "Header with content type and file name",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        "X-Rate-Limit-Limit": {
          "description": "Request limit per second",
          "schema": {
            "type": "integer"
          }
        },
        "X-Rate-Limit-Remaining": {
          "description": "The remaining number of requests (count).",
          "schema": {
            "type": "integer"
          }
        },
        "X-Rate-Limit-Reset": {
          "description": "The time in milliseconds before the remain rate count is reset.",
          "schema": {
            "type": "integer"
          }
        }
      },
      "content": {
        "application/zip": {
          "schema": {
            "description": "ZIP archive with extract files in Excel format",
            "example": "<byte array>"
          }
        },
        "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
          "schema": {
            "description": "Excel file",
            "example": "<массив байтов>"
          }
        }
      }
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "404": {
      "description": "No statements were found for the specified keys"
    },
    "429": {
      "$ref": "#/components/responses/RateLimit"
    }
  }
}

Схемы и примеры

{
  "headers": {
    "X-Rate-Limit-Limit": {
      "description": "Request limit per second",
      "schema": {
        "type": "integer"
      }
    },
    "X-Rate-Limit-Remaining": {
      "description": "The remaining number of requests (count).",
      "schema": {
        "type": "integer"
      }
    },
    "X-Rate-Limit-Reset": {
      "description": "The time in milliseconds before the remain rate count is reset.",
      "schema": {
        "type": "integer"
      }
    },
    "Content-Disposition": {
      "description": "Header with content type and file name",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  },
  "securitySchemes": {
    "bearerAuth": {
      "type": "http",
      "scheme": "bearer",
      "description": "Access token",
      "bearerFormat": "JWT"
    }
  },
  "schemas": {
    "GatewayErrorResponse": {
      "type": "object",
      "required": [
        "http_status_code",
        "message"
      ],
      "properties": {
        "http_status_code": {
          "description": "HTTP status",
          "type": "integer"
        },
        "message": {
          "description": "Error",
          "type": "string"
        }
      }
    },
    "StatementsDownloadPdfRequest": {
      "description": "Request to download statements",
      "type": "object",
      "required": [
        "statementKey",
        "detail"
      ],
      "properties": {
        "statementKey": {
          "description": "List of keys of statements to be downloaded",
          "type": "array",
          "items": {
            "description": "Key of statement (format “account number:cnum:date”)",
            "type": "string"
          },
          "example": [
            "40700000000001000000:Z59280:20211124",
            "40700010000000000000:Z59280:20211124"
          ]
        },
        "detail": {
          "description": "Detailing (without - only statement, with - statement with attachments, only - only attachments)",
          "type": "string",
          "enum": [
            "with",
            "without",
            "only"
          ],
          "example": "without"
        },
        "separate": {
          "description": "false - combine several statements into one file",
          "type": "boolean",
          "default": false,
          "example": false
        },
        "filename": {
          "description": "Name of the resulting PDF files with statements",
          "type": "string",
          "example": "example"
        },
        "sort": {
          "description": "Sorting columns of the statement",
          "type": "array",
          "items": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SortDebet"
              },
              {
                "$ref": "#/components/schemas/SortCredit"
              }
            ]
          }
        }
      }
    },
    "StatementsDownloadExcelRequest": {
      "description": "Request to download statements",
      "type": "object",
      "required": [
        "accountKey",
        "from",
        "to"
      ],
      "properties": {
        "accountKey": {
          "description": "List of keys of statements to be downloaded",
          "type": "array",
          "items": {
            "description": "Key of statement (format “account number:cnum”)",
            "type": "string",
            "example": [
              "40700000000001000000:Z59280",
              "40700010000000000000:Z59280"
            ]
          }
        },
        "intraday": {
          "description": "true - include intraday operations",
          "type": "boolean",
          "default": false,
          "example": false
        },
        "filename": {
          "description": "Name of the resulting PDF files with statements",
          "type": "string",
          "example": "Выписка"
        },
        "from": {
          "description": "From date (formate \"yyyy-MM-dd'T'HH:mm:ss.SSSXXX\")",
          "type": "string",
          "example": "2022-06-05T21:00:00.000Z"
        },
        "to": {
          "description": "To date (formate \"yyyy-MM-dd'T'HH:mm:ss.SSSXXX\")",
          "type": "string",
          "example": "2022-06-12T20:59:59.000Z"
        },
        "sort": {
          "description": "Sorting columns of the statement",
          "type": "array",
          "items": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SortDebet"
              },
              {
                "$ref": "#/components/schemas/SortCredit"
              }
            ]
          }
        }
      }
    },
    "SortDebet": {
      "description": "Direction of the column sorting",
      "type": "object",
      "required": [
        "field",
        "desc"
      ],
      "properties": {
        "field": {
          "description": "Column name (debet)",
          "type": "string",
          "example": "debet"
        },
        "desc": {
          "description": "true - reverse direction of sorting",
          "type": "boolean",
          "example": true
        }
      }
    },
    "SortCredit": {
      "description": "Direction of the column sorting",
      "type": "object",
      "required": [
        "field",
        "desc"
      ],
      "properties": {
        "field": {
          "description": "Column name (credit)",
          "type": "string",
          "example": "credit"
        },
        "desc": {
          "description": "true - reverse direction of sorting",
          "type": "boolean",
          "example": false
        }
      }
    }
  },
  "responses": {
    "Unauthorized": {
      "description": "Unauthorized",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/GatewayErrorResponse"
          },
          "example": {
            "http_status_code": 401,
            "message": "Unauthorized"
          }
        }
      }
    },
    "RateLimit": {
      "description": "Exceeded the maximum number of request",
      "headers": {
        "X-Rate-Limit-Limit": {
          "description": "Request limit per second",
          "schema": {
            "type": "integer"
          }
        },
        "X-Rate-Limit-Remaining": {
          "description": "The remaining number of requests (count).",
          "schema": {
            "type": "integer"
          }
        },
        "X-Rate-Limit-Reset": {
          "description": "The time in milliseconds before the remain rate count is reset.",
          "schema": {
            "type": "integer"
          }
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/GatewayErrorResponse"
          },
          "example": {
            "http_status_code": 429,
            "message": "Rate limit exceeded ! You reach the limit of 10 requests per 10 seconds"
          }
        }
      }
    },
    "BadRequest": {
      "description": "Bad request"
    }
  },
  "parameters": {
    "IdTokenHeader": {
      "name": "Id-Token",
      "in": "header",
      "description": "User ID token",
      "required": true,
      "schema": {
        "type": "string",
        "format": "byte"
      }
    }
  }
}