RPP CIB Import
OpenAPI 0.3
Варианты
- Паблик
Операции API
POST /v2/payment-orders/import/1C
{
"tags": [
"Import payment-order"
],
"parameters": [
{
"$ref": "#/components/parameters/IdTokenHeader"
}
],
"requestBody": {
"required": true,
"content": {
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/ImportRequest"
}
}
}
},
"responses": {
"201": {
"$ref": "#/components/responses/Created"
},
"400": {
"$ref": "#/components/responses/BadRequestImport"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"500": {
"$ref": "#/components/responses/InternalError"
}
}
}POST /v2/payment-orders/import/MT103
{
"tags": [
"Import payment-order"
],
"parameters": [
{
"$ref": "#/components/parameters/IdTokenHeader"
}
],
"requestBody": {
"required": true,
"content": {
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/ImportRequest"
}
}
}
},
"responses": {
"201": {
"$ref": "#/components/responses/Created"
},
"400": {
"$ref": "#/components/responses/BadRequestImport"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"500": {
"$ref": "#/components/responses/InternalError"
}
}
}POST /v2/payment-orders/import/XML
{
"tags": [
"Import payment-order"
],
"parameters": [
{
"$ref": "#/components/parameters/IdTokenHeader"
}
],
"requestBody": {
"required": true,
"content": {
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/ImportXMLRequest"
}
}
}
},
"responses": {
"201": {
"$ref": "#/components/responses/Created"
},
"400": {
"$ref": "#/components/responses/BadRequestImport"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"500": {
"$ref": "#/components/responses/InternalError"
}
}
}POST /v2/mass-payment/import/1C
{
"tags": [
"Import mass-payment"
],
"parameters": [
{
"$ref": "#/components/parameters/IdTokenHeader"
}
],
"requestBody": {
"required": true,
"content": {
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/ImportRequest"
}
}
}
},
"responses": {
"201": {
"$ref": "#/components/responses/Created"
},
"400": {
"$ref": "#/components/responses/BadRequestImport"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"500": {
"$ref": "#/components/responses/InternalError"
}
}
}POST /v2/mass-payment/import/MT103
{
"tags": [
"Import mass-payment"
],
"parameters": [
{
"$ref": "#/components/parameters/IdTokenHeader"
}
],
"requestBody": {
"required": true,
"content": {
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/ImportRequest"
}
}
}
},
"responses": {
"201": {
"$ref": "#/components/responses/Created"
},
"400": {
"$ref": "#/components/responses/BadRequestImport"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"500": {
"$ref": "#/components/responses/InternalError"
}
}
}POST /v2/mass-payment/import/XML
{
"tags": [
"Import mass-payment"
],
"parameters": [
{
"$ref": "#/components/parameters/IdTokenHeader"
}
],
"requestBody": {
"required": true,
"content": {
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/ImportXMLRequest"
}
}
}
},
"responses": {
"201": {
"$ref": "#/components/responses/Created"
},
"400": {
"$ref": "#/components/responses/BadRequestImport"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"500": {
"$ref": "#/components/responses/InternalError"
}
}
}GET /v2/import-status/{importTaskId}
{
"tags": [
"Import status"
],
"operationId": "getImportProcess",
"parameters": [
{
"$ref": "#/components/parameters/IdTokenHeader"
},
{
"name": "importTaskId",
"in": "path",
"required": true,
"description": "Document import task ID",
"schema": {
"type": "string",
"example": "e71fa97f-135c-4dcf-868e-66be217321e1"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ImportStatusResponse"
},
"examples": {
"success import": {
"value": {
"importTaskId": "e71fa97f-135c-4dcf-868e-66be217321e1",
"startTime": "2023-07-01T15:45:32.752+0300",
"endTime": "2023-07-01T15:45:33.185+0300",
"importStatus": "COMPLETED",
"importFormat": "XML",
"massPaymentId": "13b48ad0a8aa4a2593",
"massPaymentStatus": "DRAFT",
"documentsInfo": [
{
"documentListNumber": 1,
"fileName": "import_file001",
"message": "Номер счета получателя должен состоять из 20 цифр",
"documentStatus": "REJECTED"
},
{
"documentListNumber": 2,
"fileName": "import_file001",
"paymentId": "13b48as0a8ef2a3928",
"documentNumber": 138,
"documentStatus": "IMPORTED"
},
{
"documentListNumber": 3,
"fileName": "import_file001",
"paymentId": "13b48dp0a0ef2c6281",
"message": "Ошибка в поле ИНН получателя",
"documentNumber": 139,
"documentStatus": "DRAFT"
}
]
}
},
"error import": {
"value": {
"importTaskId": "e71fa97f-135c-4dcf-868e-66be217321e1",
"message": "Непредвиденная техническая ошибка при обработке задания на импорт",
"startTime": "2023-07-01T15:45:32.752+0300",
"endTime": "2023-07-01T15:45:33.185+0300",
"importStatus": "ERROR",
"importFormat": "1C"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequestImportStatus"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalError"
}
}
}Схемы и примеры
{
"securitySchemes": {
"bearerAuth": {
"type": "http",
"scheme": "bearer",
"description": "Access token",
"bearerFormat": "JWT"
}
},
"responses": {
"Created": {
"description": "Import process started",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ImportResponse"
}
}
}
},
"BadRequestImport": {
"description": "Request contains errors or the file is empty"
},
"BadRequestImportStatus": {
"description": "Request contains errors"
},
"Unauthorized": {
"description": "Authentication failed"
},
"Forbidden": {
"description": "Insufficient rights to import payment-orders"
},
"NotFound": {
"description": "Wrong import task ID"
},
"InternalError": {
"description": "Internal error"
}
},
"schemas": {
"ImportRequest": {
"required": [
"files"
],
"type": "object",
"properties": {
"files": {
"type": "array",
"description": "One or more files with payment orders .txt",
"items": {
"type": "string",
"format": "binary"
}
},
"notes": {
"type": "string",
"description": "Notes. Will be attached at each of payment-orders in file",
"example": "This is the note i would like to see in payment-order"
}
}
},
"ImportXMLRequest": {
"required": [
"files"
],
"type": "object",
"properties": {
"files": {
"type": "array",
"description": "One or more files with payment orders .xml",
"items": {
"type": "string",
"format": "binary"
}
},
"notes": {
"type": "string",
"description": "Notes. Will be attached at each of payment-orders in file",
"example": "This is the note i would like to see in payment-order"
}
}
},
"ImportResponse": {
"required": [
"importTaskId"
],
"type": "object",
"properties": {
"importTaskId": {
"type": "string",
"description": "ID of the process of importing. Required for the further import status request performing",
"example": "e71fa97f-135c-4dcf-868e-66be217321e1"
}
}
},
"ImportStatusResponse": {
"required": [
"importTaskId",
"startTime",
"importStatus",
"importFormat"
],
"type": "object",
"properties": {
"importTaskId": {
"type": "string",
"description": "ID of the process of importing"
},
"message": {
"type": "string",
"description": "Error message"
},
"startTime": {
"type": "string",
"description": "Time when import was started (GMT+3)",
"format": "date-time"
},
"endTime": {
"type": "string",
"description": "Time when import has been completed (GMT+3). Shows only if importStatus is in status COMPLETED or ERROR",
"format": "date-time"
},
"importStatus": {
"type": "string",
"description": "Import process status",
"enum": [
"IN_PROGRESS",
"COMPLETED",
"ERROR"
]
},
"importFormat": {
"type": "string",
"description": "Import format",
"enum": [
"1C",
"XML",
"MT103"
]
},
"massPaymentId": {
"type": "string",
"description": "Unique ID of the mass payment (Shows only if importing a mass payment)"
},
"massPaymentStatus": {
"type": "string",
"description": "Mass payment status (Shows only if importing a mass payment)",
"enum": [
"IMPORT_PROCESS (import process is not yet fully completed, but mass payment file has already been created)",
"IMPORTED (all payments as part of mass payment file are imported without errors)",
"DRAFT (at least one payment as part of mass payment file imported in the DRAFT status)",
"REJECTED (payments are incorrect, mass payment file is not imported)"
]
},
"documentsInfo": {
"type": "array",
"description": "Information on each document (payment order) in the file",
"items": {
"type": "object",
"properties": {
"documentListNumber": {
"type": "integer",
"example": 1,
"description": "The serial number of the document (payment order) in the file"
},
"fileName": {
"type": "string",
"example": "import_file001",
"description": "filename using for payment import"
},
"paymentId": {
"type": "string",
"example": "13b48as0a8ef2a3928",
"description": "Unique ID of imported payment-order. Assigning a value only if documentStatus have the status IMPORTED or DRAFT"
},
"message": {
"type": "string",
"example": "Beneficiary's INN number contains errors",
"description": "Error message"
},
"documentNumber": {
"type": "string",
"example": 137,
"description": "Document number"
},
"documentStatus": {
"type": "string",
"example": "DRAFT",
"description": "Document status",
"enum": [
"IMPORTED",
"DRAFT",
"REJECTED"
]
}
}
}
}
}
}
},
"parameters": {
"IdTokenHeader": {
"name": "Id-Token",
"in": "header",
"description": "ID token",
"required": true,
"schema": {
"type": "string",
"format": "byte"
}
}
}
}