---
# System prepended metadata

title: Reconcile API Reference

---

# Reconcile API Reference

## Matching
### `Post api/v1/matching/match`


**Header**
| Name                        | Description                  | Schema  |
| --------------------------  | ---------------------------- | ------- |
| Authorization (require)     |                              | string  |

**Body parameter**
| Parameter                   | Description                  | Schema  |
| --------------------------  | ---------------------------- | ------- |
| registers (option)      | ข้อมูล registers ที่เลือก        | array(registers Model)  |
| bankTransactionCode (option)  |  ข้อมูล matching        | array(int)  |

*registers Model*
| Parameter             | Description                                    | Schema         |
| --------------------- | ---------------------------------------------- | -------------- |
| registerCode (option) |                                                | int     |
| flag (option)  |  flag ที่บอกว่าเลือก register นี้ในการ matching  | int(enum flag)|

#### Example Request
```json
{
    "registers": [
      {
        "registerCode": 50,
        "flag": 1
      },
      {
        "registerCode": 51,
        "flag": 2
      }
    ],
    "bankTransactionCode": [
      77,
      40
    ]
}
```

#### Example Response
```json
{
  "code": 0,
  "message": "success"
}
```
#### Response Code
```
  code: 0
```

### `Post api/v1/matching/register-detail`


**Header**
| Name                        | Description                  | Schema  |
| --------------------------  | ---------------------------- | ------- |
| Authorization (require)     |                              | string  |

**Body parameter**
| Parameter                   | Description                  | Schema  |
| --------------------------  | ---------------------------- | ------- |
| registerCode (require)      |                              | int  |

#### Example Request
```json
{
    "registerCode": 0
}
```

#### Example Response
```json
{
  "code": 0,
  "message": "Success",
  "data": {
    "listRegister": [
      {
        "registerCode": 0,
        "name": "Name",
        "surname": "Surname",
        "idCardNumber": "1234567890000",
        "idCardType": 1,
        "idCardImage": "https://s3.ap-southeast-1.amazonaws.com/cuvaccine-s3-bucket/5c5506ae-115d-4512-b30c-9ad4ba106f75/IdCard/5274ac64-c0b3-42ab-a83c-a60715961651__2021-01-18",
        "totalAmount": 900.22,
        "transactionData": [
          {
            "slipImage": {
              "slipLink": "https://www.kasikornbank.com/SiteCollectionDocuments/personal/digital-banking/kplus/functions/verified-slip/img/img-03.png",
              "fileName": "SlipFile",
              "contentType": "image/jpeg"
            },
            "amount": 500.11,
            "transactionDate": "2021-01-22T04:23:51.6063779Z",
            "refTransferCode": "ASD123",
            "bankAccountNumber": "123456123",
            "bankAccountName": "Some One",
            "bankName": "TMB",
            "bankAccountNumberReceive": "456456456",
            "bankAccountNameReceive": "Some One",
            "bankNameReceive": "KTB"
          }
        ]
      }
    ]
  }
}
```
#### Response Code
```
  code: 0
```
   

### `Post api/v1/matching/bank-transaction`


**Header**
| Name                        | Description                  | Schema  |
| --------------------------  | ---------------------------- | ------- |
| Authorization (require)     |                              | string  |
**Body parameter**
| Parameter                   | Description                  | Schema  |
| --------------------------  | ---------------------------- | ------- |
| registerCode (require)      |                              | int     |
| search (option)      |                                     | string     |
| transactionDate (option)      |                            | datetime     |
| status (option)      |                                     | int     |

#### Example Request
```json
{
    "registerCode": 0,
    "search": "string"
    "transactionDate": "2020-08-15T12:21:10+00:00",
    "status": 0
}
```

#### Example Response
```json
{
  "code": 0,
  "message": "success",
  "data": {
    "listTransaction": [
      {
        "transactionCode": 0,
        "transactionDate": "2020-08-15T12:21:10+00:00",
        "refTransferCode": "string",
        "bankAccountNumber": "string",
        "bankName": "string",
        "amount": 500.55,
        "name": "string",
        "surname": "string"
      }
    ]
  }
}
```
#### Response Code
```
  code: 0
```

### `Post api/v1/matching/register-list`

**Header**
| Name                        | Description                  | Schema  |
| --------------------------  | ---------------------------- | ------- |
| Authorization (require)     |                              | string  |


**Body parameter**
| Parameter                   | Description                  | Schema  |
| --------------------------  | ---------------------------- | ------- |
| search (option)      |  name/surname/nameEng/surnameEng                                   | string  |
| flag (require)      |   flag status ของ register           | int     |

#### Example Request
```json
{
    "search": "string",
    "flag": 0,
    "page": 0,
    "pageSize": 0
}
```

#### Example Response
```json
{
  "data": {
    "listRegister": [
      {
        "name": "ทดสอบ รายการ Register",
        "surname": "นามสกุล",
        "nameEng": "Name",
        "surnameEng": "Surname",
        "idCardNumber": "123456789000",
        "transactionDate": "2021-01-22T04:22:06.909642Z",
        "refTransferCode": "123456",
        "amount": 500.55,
        "bankName": "KTB",
        "bankNameReceive": "KTB",
        "registerCode": 0,
        "matchingCode": 0
      },
      {
        "name": "ทดสอบ รายการ Register 2",
        "surname": "นามสกุล 2",
        "nameEng": "Name",
        "surnameEng": "Surname",
        "idCardNumber": "123456789000",
        "transactionDate": "2021-01-22T04:22:06.9096876Z",
        "refTransferCode": "123456",
        "amount": 666.66,
        "bankName": "TMB",
        "bankNameReceive": "KTB",
        "registerCode": 0,
        "matchingCode": 0
      }
    ],
    "count": 0
  },
  "code": 0,
  "message": "Success"
}
```
#### Response Code
```
  code: 0
```



## Audit
### `Post api/v1/audit/detail`


**Header**
| Name                        | Description                  | Schema  |
| --------------------------  | ---------------------------- | ------- |
| Authorization (require)     |                              | string  |

**Body parameter**
| Parameter                   | Description                  | Schema  |
| --------------------------  | ---------------------------- | ------- |
| registerCode (require)      |                              | int  |

#### Example Request
```json
{
    "registerCode": 0
}
```

#### Example Response
```json
{
  "code": 0,
  "message": "Success",
  "data": {
        "registerCode": 0,
        "name": "Name",
        "surname": "Surname",
        "idCardNumber": "1234567890000",
        "idCardType": 1,
        "idCardImage": "https://s3.ap-southeast-1.amazonaws.com/cuvaccine-s3-bucket/5c5506ae-115d-4512-b30c-9ad4ba106f75/IdCard/5274ac64-c0b3-42ab-a83c-a60715961651__2021-01-18",
        "totalAmount": 900.22,
        "flag": 1,
        "transactionData": [
          {
            "slipImage": {
              "slipLink": "https://www.kasikornbank.com/SiteCollectionDocuments/personal/digital-banking/kplus/functions/verified-slip/img/img-03.png",
              "fileName": "SlipFile",
              "contentType": "image/jpeg"
            },
            "amount": 500.11,
            "transactionDate": "2021-01-22T04:23:51.6063779Z",
            "refTransferCode": "ASD123",
            "bankAccountNumber": "123456123",
            "bankAccountName": "Some One",
            "bankName": "TMB"
          }
        ]
     }
  }
}

```
#### Response Code
```
  code: 0
```
   

### Post api/v1/audit/bank-transaction


**Header**
| Name                        | Description                  | Schema  |
| --------------------------  | ---------------------------- | ------- |
| Authorization (require)     |                              | string  |
**Body parameter**
| Parameter                   | Description                  | Schema  |
| --------------------------  | ---------------------------- | ------- |
| registerCode (require)      |                              | int     |

#### Example Request
```json
{
    "registerCode": 0
}
```

#### Example Response
```json
{
  "code": 0,
  "message": "success",
  "data": {
    "listTransaction": [
      {
        "transactionCode": 0,
        "transactionDate": "2020-08-15T12:21:10+00:00",
        "refTransferCode": "string",
        "bankAccountNumber": "string",
        "bankName": "string",
        "amount": 500.55,
        "name": "string",
        "surname": "string"
      }
    ]
  }
}
```
#### Response Code
```
  code: 0
```

### `Post api/v1/audit/list`

**Header**
| Name                        | Description                  | Schema  |
| --------------------------  | ---------------------------- | ------- |
| Authorization (require)     |                              | string  |


**Body parameter**
| Parameter                   | Description                  | Schema  |
| --------------------------  | ---------------------------- | ------- |
| search (option)      |  name/surname/nameEng/surnameEng    | string  |


#### Example Request
```json
{
    "search": "string",
    "page": 0,
    "pageSize": 0
}
```

#### Example Response
```json
{
  "data": {
    "listAudit": [
      {
        "name": "ทดสอบ รายการ Register",
        "surname": "นามสกุล",
        "nameEng": "Name",
        "surnameEng": "Surname",
        "idCardNumber": "123456789000",
        "idCardType": 0,
        "registerCode": 0
      },
      {
        "name": "ทดสอบ รายการ Register 2",
        "surname": "นามสกุล 2",
        "nameEng": "Name",
        "surnameEng": "Surname",
        "idCardNumber": "123456789000",
        "idCardType": 0,
        "registerCode": 0
      }
    ],
    "count": 0
  },
  "code": 0,
  "message": "Success"
}
```
#### Response Code
```
  code: 0
```

### `Post api/v1/audit/cofirm-matching`

**Header**
| Name                        | Description                  | Schema  |
| --------------------------  | ---------------------------- | ------- |
| Authorization (require)     |                              | string  |

**Body parameter**
| Parameter                   | Description                  | Schema  |
| --------------------------  | ---------------------------- | ------- |
| registerCode (require)      |         | int  |
| bankTransactionCode (option)  |          | array(int)  |


#### Example Request
```json
{
    "registerCode":0, 
    "bankTransactionCode": [
      77,
      40,
    ]
}
```

#### Example Response
```json
{
  "code": 0,
  "message": "success"
}
```
#### Response Code
```
  code: 0
```

# Enum Reference
## Response Code

| number | description         |
| -------| ------------        |
| 0      | success             |
| 1      | ไม่เจอ email หรือ phone ในระบบ             |
| 2      | OTP ไม่ถูกต้อง             |
| 3      | refresh token หมดอายุ/ไม่ถูกต้อง             |
| 4      | token หมดอายุ/ไม่ถูกต้อง (ปกติจะไม่เกิดเพราะควรจะเจอ http error 401 ก่อน)             |
| 5      | เบอร์โทรศัพท์หรือบัตรประชาชนนี้มีสิทธิ์แล้ว             |
| 6      | สิทธิ์ของ user ถูกใช้ไปแล้ว             |
| 7      | สิทธิ์ของ donator หมดแล้ว             |
| 8      | report type ไม่ถูกต้อง             |
| 9      | ไม่เจอ Donator ในระบบ             |
| 10      | เบอร์โทรศัพท์ หรือ รหัสไปรษณีย์ ผิด format             |
| 11      | email ผิด format             |
| 12      | ไม่มี Register             |
| 13      | ไม่มี Bank Transaction             |
| 14     | ไม่มี Transaction             |
| 15      | flag matching มากกว่า1             |