# მოთხოვნა

მეთოდის საშუალებით შესაძლებელია, უცხოურ  ვალუტაში, ერთი ან რამდენიმე ინდივიდუალური დოკუმენტის შექმნა.

## პარამეტრები

- `Charges` — string, required

  გადარიცხვის მეთოდი. იღებს შემდეგ მნიშვნელობებს:
  - `SHA` - (SWIFT) თანხის გამგზავნი იხდის მხოლოდ გამგზავნი ბანკის მიერ დადგენილ ყველა საკომისიოს.
  - `OUR` - (SWIFT) თანხის გამგზავნი იხდის გადარიცხვასთან დაკავშირებულ ყველა საკომისიოს.
  - `BULK` - (RTGS) სტანდარტული გადარიცხვა. შესაძლებელია მხოლოდ 10 000 USD/EUR-მდე ოპერაციის დროს.
  - `MT103` - (RTGS) ინდივიდუალური გადარიცხვა.

  RTGS გადარიცხვა შესაძლებელია მხოლოდ ქართულ ბანკებში, USD ან EUR ვალუტაში.

- `BeneficiaryBankName` — string

  მიმღები ბანკის დასახელება. SWIFT გადარიცხვისას BeneficiaryBankCode ან BeneficiaryBankName ველის შევსება სავალდებულოა. RTGS გადარიცხვის შემთხვევაში ველი უნდა დარჩეს ცარიელი.

- `IntermediaryBankCode` — string

  შუამავალი ბანკის SWIFT კოდი. RTGS გადარიცხვის შემთხვევაში ველი უნდა დარჩეს ცარიელი.

- `IntermediaryBankName` — string

  შუამავალი ბანკის დასახელება. RTGS გადარიცხვის შემთხვევაში ველი უნდა დარჩეს ცარიელი.

- `PaymentDetail` — string

  გადარიცხვის საფუძველი, დანიშნულება (მაქსიმუმ 4x34 136 სიმბოლო).

- `ValueDate` — date, required

  ვალუტირების თარიღი.

- `BeneficiaryRegistrationCountryCode` — string

  მიმღების რეგისტრაციის ქვეყანა.

- `BeneficiaryActualCountryCode` — string

  მიმღების ფაქტობრივი ქვეყანა.

- `RecipientAddress` — string

  მიმღების მისამართი. RTGS გადარიცხვის შემთხვევაში ველი უნდა დარჩეს ცარიელი.

- `RecipientCity` — string

  მიმღების ქალაქი. RTGS გადარიცხვის შემთხვევაში ველი უნდა დარჩეს ცარიელი.

- `RegReportingValue` — string

  დამატებითი დანიშნულების ველი (გამოიყენება არაბეთის გაერთიანებულ საემიროებში გადარიცხვისას).

- `UniqueId` — globally unique identifier, required

  გარე (გამომძახებელ) სისტემაში დოკუმენტის უნიკალური იდენტიფიკატორი (Guid).

- `Amount` — decimal number, required

  დოკუმენტის თანხა.

- `Currency` — string, required

  დოკუმენტის ვალუტა.

- `DocumentNo` — string, required

  დოკუმენტის ნომერი.

- `SourceAccountNumber` — string, required

  გამგზავნის ანგარიში, ანგარიშიდან / მხოლოდ IBAN-ის ფორმატი, მაგ: GE11BG1111111111111111GEL

- `BeneficiaryAccountNumber` — string, required

  მიმღების ანგარიში.
  საქართველოს ბანკში ან სხვა ბანკში ეროვნული ვალუტის გადარიცხვისას  – მხოლოდ IBAN-ის ფორმატი.
  ხაზინაში გადარიცხვისას - სახაზინო კოდი.
  უცხოური ვალუტის გადარიცხვისას - ანგარიშის ნომერი არსებული ფორმატით.

- `BeneficiaryBankCode` — string

  მიმღები ბანკის BIC კოდი. RTGS გადარიცხვის შემთხვევაში ველი უნდა დარჩეს ცარიელი.

- `BeneficiaryInn` — string, max-length: 11

  ფიზიკური პირის შემთხვევაში მიმღების პირადი  ნომერი, იურიდიული პირის შემთხვევაში მისი საიდენტიფიკაციო კოდი.

- `CheckInn` — string

  “საქართველოს ბანკში“ გადარიცხვის დროს, შემოწმდეს თუ არა მიმღების ანგარიშის თავსებადობა მის საიდენტიფიკაციო კოდთან. იღებს ორ მნიშვნელობას:
  - `TRUE` - დამატებით შემოწმდება მიმღების ანგარიშის ნომრის მითითებული საიდენტიფიკაციო კოდით. თუ ანგარიშის ნომერი არ ეკუთვნის მითითებულ საიდენტიფიკაციო კოდზე არსებულ ანგარიშს, დაფიქსირდება შეცდომა.
  - `FALSE` - გადარიცხვა შემოწმდება სტანდარტული წესით.
  სხვა ბანკში გადარიცხვისას ამ ველის მნიშვნელობა უნდა იყოს `False`.

- `BeneficiaryName` — string

  მიმღების დასახელება.

- `CommissionAccountNumber` — string

  საკომისიოს ანგარიში, მხოლოდ ინდივიდუალური გადარიცხვისთვის / მხოლოდ IBAN-ის ფორმატი, მაგ: GE11BG1111111111111111GEL, ანგარიშის არასწორედ მითითების შემთხვევაში საკომისიო (არსებობის შეთხვევაში) ჩამოიწღება იმ ანგარიშიდან რომლიდანაც გადარიცხვა ხდება

- `AdditionalInformation` — string

  დამატებითი ინფორმაცია. არ გამოიყენება ეროვნული ვალუტის გადარიცხვისას.

- `AttachmentIds` — array of string

  დანართების ჰეშების სია. თითოეული ჰეში (`externalFileHash`) მიიღება [ფაილის ატვირთვის](../files/upload.md) ენდპოინტიდან. ივსება მხოლოდ მაშინ, თუ დოკუმენტს დანართის მიბმა გსურთ.

- `PurposeCode` — string

  გადარიცხვის დანიშნულების კოდი. გამოიყენება სავალუტო ოპერაციების რეპორტინგისთვის.

- `CheckUniqueId` — boolean

  თუ `true`, დოკუმენტის შექმნამდე შემოწმდება, ბოლო 7 დღის განმავლობაში იმავე `UniqueId`-ით დოკუმენტი უკვე შეიქმნა თუ არა. დუბლიკატის აღმოჩენისას ახალი დოკუმენტი არ იქმნება და ბრუნდება შედეგის კოდი `702`.

**JSON**

```api
POST api/documents/foreign
Content-Type: application/json
```

```json
[
  {
    "Charges": "sample string 1",
    "CommissionAccountNumber": "sample string 2",
    "BeneficiaryBankName": "sample string 3",
    "IntermediaryBankCode": "sample string 4",
    "IntermediaryBankName": "sample string 5",
    "PaymentDetail": "sample string 6",
    "ValueDate": "2021-06-17T12:03:37.4722861+04:00",
    "BeneficiaryRegistrationCountryCode": "sample string 8",
    "BeneficiaryActualCountryCode": "sample string 9",
    "RecipientAddress": "sample string 10",
    "RecipientCity": "sample string 11",
    "RegReportingValue": "sample string 12",
    "UniqueId": "c6b8cc64-072d-4849-9b7a-a40dc5faa3af",
    "Amount": 14.0,
    "Currency": "sample string 15",
    "DocumentNo": "sample string 16",
    "SourceAccountNumber": "sample string 17",
    "BeneficiaryAccountNumber": "sample string 18",
    "BeneficiaryBankCode": "sample string 19",
    "BeneficiaryInn": "sample string 20",
    "CheckInn": true,
    "BeneficiaryName": "sample string 22",
    "AdditionalInformation": "sample string 23",
    "AttachmentIds": ["sample string 24"]
  },
  {
    "Charges": "sample string 1",
    "CommissionAccountNumber": "sample string 2",
    "BeneficiaryBankName": "sample string 3",
    "IntermediaryBankCode": "sample string 4",
    "IntermediaryBankName": "sample string 5",
    "PaymentDetail": "sample string 6",
    "ValueDate": "2021-06-17T12:03:37.4722861+04:00",
    "BeneficiaryRegistrationCountryCode": "sample string 8",
    "BeneficiaryActualCountryCode": "sample string 9",
    "RecipientAddress": "sample string 10",
    "RecipientCity": "sample string 11",
    "RegReportingValue": "sample string 12",
    "UniqueId": "c6b8cc64-072d-4849-9b7a-a40dc5faa3af",
    "Amount": 14.0,
    "Currency": "sample string 15",
    "DocumentNo": "sample string 16",
    "SourceAccountNumber": "sample string 17",
    "BeneficiaryAccountNumber": "sample string 18",
    "BeneficiaryBankCode": "sample string 19",
    "BeneficiaryInn": "sample string 20",
    "CheckInn": true,
    "BeneficiaryName": "sample string 22",
    "AdditionalInformation": "sample string 23",
    "AttachmentIds": ["sample string 24"]
  }
]
```

**XML**

```api
POST api/documents/foreign
Content-Type: application/xml
```

```xml
<ArrayOfForeignPayment xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CIBApi.Models">
  <ForeignPayment>
    <AdditionalInformation>sample string 23</AdditionalInformation>
    <Amount>14</Amount>
    <BeneficiaryAccountNumber>sample string 18</BeneficiaryAccountNumber>
    <BeneficiaryBankCode>sample string 19</BeneficiaryBankCode>
    <BeneficiaryInn>sample string 20</BeneficiaryInn>
    <BeneficiaryName>sample string 22</BeneficiaryName>
    <CheckInn>true</CheckInn>
    <Currency>sample string 15</Currency>
    <DocumentNo>sample string 16</DocumentNo>
    <SourceAccountNumber>sample string 17</SourceAccountNumber>
    <UniqueId>c6b8cc64-072d-4849-9b7a-a40dc5faa3af</UniqueId>
    <BeneficiaryActualCountryCode>sample string 9</BeneficiaryActualCountryCode>
    <BeneficiaryBankName>sample string 3</BeneficiaryBankName>
    <BeneficiaryRegistrationCountryCode>sample string 8</BeneficiaryRegistrationCountryCode>
    <Charges>sample string 1</Charges>
    <CommissionAccountNumber>sample string 2</CommissionAccountNumber>
    <IntermediaryBankCode>sample string 4</IntermediaryBankCode>
    <IntermediaryBankName>sample string 5</IntermediaryBankName>
    <PaymentDetail>sample string 6</PaymentDetail>
    <RecipientAddress>sample string 10</RecipientAddress>
    <RecipientCity>sample string 11</RecipientCity>
    <RegReportingValue>sample string 12</RegReportingValue>
    <ValueDate>2021-06-17T12:03:37.4722861+04:00</ValueDate>
    <AttachmentIds xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>sample string 24</d3p1:string>
    </AttachmentIds>
  </ForeignPayment>
  <ForeignPayment>
    <AdditionalInformation>sample string 23</AdditionalInformation>
    <Amount>14</Amount>
    <BeneficiaryAccountNumber>sample string 18</BeneficiaryAccountNumber>
    <BeneficiaryBankCode>sample string 19</BeneficiaryBankCode>
    <BeneficiaryInn>sample string 20</BeneficiaryInn>
    <BeneficiaryName>sample string 22</BeneficiaryName>
    <CheckInn>true</CheckInn>
    <Currency>sample string 15</Currency>
    <DocumentNo>sample string 16</DocumentNo>
    <SourceAccountNumber>sample string 17</SourceAccountNumber>
    <UniqueId>c6b8cc64-072d-4849-9b7a-a40dc5faa3af</UniqueId>
    <BeneficiaryActualCountryCode>sample string 9</BeneficiaryActualCountryCode>
    <BeneficiaryBankName>sample string 3</BeneficiaryBankName>
    <BeneficiaryRegistrationCountryCode>sample string 8</BeneficiaryRegistrationCountryCode>
    <Charges>sample string 1</Charges>
    <CommissionAccountNumber>sample string 2</CommissionAccountNumber>
    <IntermediaryBankCode>sample string 4</IntermediaryBankCode>
    <IntermediaryBankName>sample string 5</IntermediaryBankName>
    <PaymentDetail>sample string 6</PaymentDetail>
    <RecipientAddress>sample string 10</RecipientAddress>
    <RecipientCity>sample string 11</RecipientCity>
    <RegReportingValue>sample string 12</RegReportingValue>
    <ValueDate>2021-06-17T12:03:37.4722861+04:00</ValueDate>
    <AttachmentIds xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>sample string 24</d3p1:string>
    </AttachmentIds>
  </ForeignPayment>
</ArrayOfForeignPayment>
```

## დაბრუნებული პარამეტრები

- `UniqueId` — globally unique identifier

  უნიკალური იდენტიფიკატორი (Guid) გარე სისტემაში.

- `UniqueKey` — integer

  დოკუმენტის უნიკალური იდენტიფიკატორი business online-ში.

- `ResultCode` — integer

  ოპერაციის შედეგის კოდი (ლინკით ResultCode გვერდზე).
  [result code](../result/result-codes.md)

- `Match` — decimal number

  შიდა გადარიცხვის დროს, თანხვედრის % თქვენ მიერ აკრეფილი მიმღების დასახელებასთან. იურიდიული პირის შემთხვევაში მოწმდება ბანკში IBAN-ის ანგარიშის მფლობელის დასახელებასთან, ფიზიკური პირის შემთხვევაში კი – სახელთან და გვართან. შედარების შედეგად ბრუნდება დამთხვევის პროცენტული მაჩვენებელი.

**JSON**

```json
[
  {
    "UniqueId": "7afaebef-5c0a-4876-aa47-13370f16fc8c",
    "UniqueKey": 2,
    "ResultCode": 1,
    "Match": 1.0
  },
  {
    "UniqueId": "7afaebef-5c0a-4876-aa47-13370f16fc8c",
    "UniqueKey": 2,
    "ResultCode": 1,
    "Match": 1.0
  }
]
```

**XML**

```xml
<ArrayOfDocumentKey xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CIBApi.Models">
  <DocumentKey>
    <Match>1</Match>
    <ResultCode>1</ResultCode>
    <UniqueId>7afaebef-5c0a-4876-aa47-13370f16fc8c</UniqueId>
    <UniqueKey>2</UniqueKey>
  </DocumentKey>
  <DocumentKey>
    <Match>1</Match>
    <ResultCode>1</ResultCode>
    <UniqueId>7afaebef-5c0a-4876-aa47-13370f16fc8c</UniqueId>
    <UniqueKey>2</UniqueKey>
  </DocumentKey>
</ArrayOfDocumentKey>
```
