post Add Or Update Ext Doc — Invoice payment
/Metadata/AddOrUpdateExtDoc(3)
Оплата счета-фактуры
Request Body
{
"Ext_ID": {
"required": true,
"type": "string",
"description": "ID внешней системы документа",
"example": ""2""
},
"DocDate": {
"required": true,
"type": "string",
"description": "Дата документа",
"example": ""15.09.2023""
},
"DocNumber": {
"required": true,
"type": "string",
"description": "Номер документа",
"example": ""1-2""
},
"DocTypeId": {
"required": true,
"type": "integer",
"description": "Тип документа:
1 – Поступление
2 – Реализация
4-Договор
5-Счет-фактура исходящий
6-Счет исходящий
7-Банк
8-Авансовый отчет
9-Отчет
10-Акт сверки
11-Входящая корреспонденция
12-Исходящая корреспонденция
13-Прочее
14-Счет входящий
15-Счет-фактура входящий
16-Необработанные
19-Служебная записка
20-Складской документ
21-Кадровый документ
22-Технический документ
",
"format": "int32",
"example": "14"
},
"Source": {
"required": true,
"type": "string",
"description": "Источник:
• Входящий
• Исходящий
",
"example": ""Входящий""
},
"RequestID": {
"required": true,
"type": "string",
"description": "ИД запроса",
"example": ""170D68C9-6B68-4176-A9B5-09A90799B64F""
},
"Currency": {
"required": false,
"type": "string",
"description": "Валюта в формате буквенном ISO 4217",
"example": ""RUR""
},
"Operation": {
"required": false,
"type": "string",
"description": "Тип операции (текстовое значение)",
"example": ""Операция с бумагами""
},
"Version1CExchange": {
"required": false,
"type": "integer",
"description": "Версия 1с конфигурации",
"format": "int32",
"example": "2000"
},
"AmountWOVAT": {
"required": false,
"type": "integer",
"description": "Сумма без НДС",
"format": "int32",
"example": "80000"
},
"Amount": {
"required": true,
"type": "integer",
"description": "Сумма с НДС",
"format": "int32",
"example": "100000"
},
"VAT": {
"required": false,
"type": "integer",
"description": "Сумма НДС",
"format": "int32",
"example": "20000"
},
"Contractor": {
"required": true,
"type": "object",
"description": "Контрагент, структура",
"properties": {
""Ext_ID"": {
"type": "string",
"description": "ID внешней системы контрагента",
"example": ""44M44""
},
""INN"": {
"type": "string",
"description": "ИНН контрагента",
"example": ""9686961876""
},
""Name"": {
"type": "string",
"description": "Название контрагента",
"example": ""ООО Орион""
},
""KPP"": {
"type": "string",
"description": "КПП контрагента",
"example": ""968601000""
}
}
},
"Organization": {
"required": true,
"type": "object",
"description": "Организация, структура",
"properties": {
""Ext_ID"": {
"type": "string",
"example": ""45M45"",
"description": "ID внешней системы организации"
},
""name"": {
"type": "string",
"example": ""ООО Ромашка"",
"description": "Название организации"
},
""inn"": {
"type": "string",
"example": ""7799555551"",
"description": "ИНН организации"
},
""kpp"": {
"type": "string",
"example": ""968601000"",
"description": "КПП организации"
}
}
},
"Contract": {
"required": false,
"type": "object",
"description": "Договор, структура",
"properties": {
""Ext_ID"": {
"type": "string",
"description": "ID внешней системы договора",
"example": ""B4EEEB4C-9DC4-43D6-BE45-B56D2C1FA40E""
}
}
},
"Signed": {
"required": false,
"type": "boolean",
"description": "Подписан документ или нет",
"example": ""
},
"PaymentNumber": {
"required": true,
"type": "string",
"description": "Номер платежного поручения",
"example": ""3-3""
},
"PaymentDate": {
"required": true,
"type": "string",
"description": "Дата платежа",
"example": ""15.09.2023""
},
"Binaries": {
"required": true,
"type": "string",
"description": "Дата платежа",
"example": ""15.09.2023""
}
}
Example
{
"Ext_ID": "2",
"DocDate": "15.09.2023",
"DocNumber": "1-2",
"DocTypeId": 14,
"Source": "Входящий",
"RequestID": "170D68C9-6B68-4176-A9B5-09A90799B64F",
"Currency": "RUR",
"Operation": "Операция с бумагами",
"Version1CExchange": 2000,
"AmountWOVAT": 80000,
"Amount": 100000,
"VAT": 20000,
"Contractor": {
"Ext_ID": "44046B99-AC13-42D2-904D-5AE103AD5A5G",
"INN": "7799555551",
"Name": "ООО Орион",
"KPP": "968601000"
},
"Organization": {
"name": "ООО Ромашка",
"inn": "9686961876",
"kpp": "968601000",
"Ext_ID": "6273"
},
"Contract": {
"Ext_ID": "B4EEEB4C-9DC4-43D6-BE45-B56D2C1FA40E",
"DocNumber": "1",
"DocDate": "14.09.2023",
"Name": "Договор поставки",
"Type": "С поставщиком",
"ValidityPeriod": "31.12.2023"
},
"Signed": true,
"PaymentNumber": "3-3",
"PaymentDate": "15.09.2023",
"MetaID": 47,
"Binaries": {
"FileName": "",
"FileBase64": ""
}
}
Responses
Response 201: Created - Счет-фактура входящий создан и оплачен
{
"string1": null,
"string2": null,
"string3": null,
"string4": null,
"string5": null,
"string6": null,
"string7": null,
"string8": null,
"datetime1": null,
"datetime2": null,
"datetime3": null,
"datetime4": null,
"int1": null,
"int2": null,
"int3": null,
"int4": null,
"bool1": null,
"bool2": null,
"bool3": null,
"bool4": null,
"idKey": "Metadata47",
"fileExists": true,
"id": 47,
"docNumber": "1-2",
"docDate": "2023-09-15T12:00:00Z",
"created": "0001-01-01T12:00:00Z",
"modified": "2021-02-15T09:01:34Z",
"modifiedBy": "ivanov@domain.ru",
"createdBy": "ivanov@domain.ru",
"docTypeId": 14,
"docType": {
"id": 14,
"name": "Счет входящий",
"reestr": "InputBills",
"reestrRu": "Счета входящие"
},
"docTypeReestr": "InputBills",
"ext_ID": "2",
"deleted": true,
"deletedBy": "ivanov@domain.ru",
"deleteDate": "2023-07-19T13:30:29Z",
"state": "Оплачено",
"ediId": null,
"ediState": null,
"ediProvider": null,
"ediProcessed": false,
"ediIsIncoming": false,
"ediLocalSigned": false,
"ediNeedExport": false,
"stageName": null,
"amount": 100000,
"amountWOVAT": 80000,
"vat": 20000,
"currency": "RUR",
"comment": null,
"createdByUser": null,
"documentType": 1,
"clientId": 1,
"client": null,
"docKindId": null,
"docKind": null,
"contractorId": 117,
"contractor": {
"id": 117,
"name": "ООО Орион",
"inn": "9686961876",
"kpp": "968601000",
"ext_ID": "44M44",
"organizationId": 40,
"organization": null,
"diadocID": null,
"type": null,
"address": null,
"contact": null,
"phone": null,
"fullName": null,
"lawAddress": null,
"bill": null,
"bank": null,
"bik": null,
"email": null,
"director": null,
"ogrn": null,
"manager": null,
"code": null,
"workKind": null,
"clientId": 1,
"client": null,
"url": null,
"comment": null
},
"organizationId": 40,
"organization": {
"id": 40,
"name": "ООО Ромашка",
"inn": "7799555551",
"kpp": "968601000",
"ext_ID": "45M45",
"clientId": 1,
"client": null,
"fullName": null,
"lawAddress": null,
"address": null,
"bill": null,
"bank": null,
"bik": null,
"phone": null,
"email": null,
"director": null,
"ogrn": null
},
"projectId": null,
"project": null,
"departmentId": null,
"department": null,
"employeeId": null,
"employeeName": null,
"employee": null,
"packageID": null,
"cardData": null,
"tablePart": null,
"source": "Входящий",
"amountToPay": 450.989990234375,
"docNumTaxInvoice": "1-1",
"docDateTaxInvoice": "2023-09-15T12:00:00Z",
"docNumInvoice": null,
"docDateInvoice": null,
"paymentDate": "2023-09-15T12:00:00Z",
"paymentNumber": "3-3",
"uploadedTo1C": false,
"signed": true,
"paid": true,
"periodFrom": null,
"periodTo": null,
"reciever": null,
"address": null,
"delivery": null,
"contact": null,
"notifyUser": "ivanov@domain.ru",
"operation": "Операция с бумагами",
"counter": null,
"contractId": 268,
"contract": {
"id": 268,
"type": "С поставщиком",
"name": "Договор поставки",
"docNumber": "12",
"docDate": "2023-07-27T12:00:00Z",
"validityPeriod": "2019-11-11T12:00:00Z",
"created": "2021-10-06T10:05:46Z",
"modified": "2023-07-27T13:09:30Z",
"modifiedBy": "ExternalSystem",
"createdBy": "ExternalSystem",
"deletedBy": null,
"ext_ID": "B4EEEB4C-9DC4-43D6-BE45-B56D2C1FA40E",
"amount": null,
"amountWOVAT": null,
"vat": null,
"currency": null,
"comment": null,
"subject": null,
"docKindId": null,
"docKind": null,
"organizationId": 40,
"organization": null,
"docTypeId": 4,
"docType": null,
"contractorId": 117,
"contractor": null,
"clientId": 1,
"client": null,
"projectId": null,
"project": null,
"deleted": false,
"deleteDate": null,
"state": "Проведено в 1С",
"ediId": null,
"ediState": null,
"ediProvider": null,
"ediProcessed": false,
"ediNeedExport": false,
"ediLocalSigned": false,
"ediIsIncoming": false,
"stageName": null,
"departmentId": null,
"department": null,
"employeeId": null,
"employee": null,
"metaId": 0
},
"type": "Операция с бумагами",
"name": null,
"validityPeriod": null,
"subject": null,
"binaries": null,
"metaID": null,
"requestID": null,
"existingContractID": null,
"nonFormID": null,
"version1CExchange": 0
}
Response 400
Unable to add the entity - Невозможно добавить объект
Bad Request - No NonFormDoc with id (1) - Не найден неформализованный документ с указанным id
Response 401
Could not find any client for this token ( #err-40) - Не найден клиент с данным токеном
Response 500
Internal Server Error - Database Failure - Внутренняя ошибка сервера