<!-- https://staircase.co/products/automation/boarding -->
# Boarding

# Boarding

Moving a closed loan into a servicer's system of record.

Boarding is a translation problem with a deadline. A servicer expects the loan in its own format, with its own required fields, within a defined window after closing — and a rejected board is manual work at the least convenient moment.

The product maps the canonical loan record into the servicer's expected shape, submits it, and returns the acknowledgment or the rejection with the field-level reasons.

## How it works

The mapping is a language configuration like any vendor mapping, which means a new servicer is a configuration rather than a code change. The general mechanism is documented under Translation.

## Operations

<!--source:api-specifications-->

### Workflow
<!--/source-->

`POST` `/import`

<!--source:api-specifications-->

#### Import
<!--/source-->

`importLoans`

<!--source:api-specifications-->
Import loans from client's environment
<!--/source-->

<!--source:api-specifications-->
Boarding supports the import of loan documents from Google Cloud storage and SFTP. Boarding expects your loans to be organized in a certain way. All documents in a loan should be in the same folder, a loan folder. The loan folder's name will be used as a loan identifier. All the loan folders should be in the same parent folder.

If you are going to import unclassified loans, set "import_classified_documents" to false. Then, the only required field is "loan_file_path" which maps the path for the loans.

Show the rest If you are going to import classified loans, set "import_classified_documents" to true. Then, the import request body must specify the mapping for loan documents. All mapping files should be in the same folder, a mapping folder. The mapping folder and loan folder should be in the same parent folder. The mapping folder should contain CSV files that describe the document types and document paths (with respect to loan folder mentioned above). Also, as part of the import request body, it provides the document type mapping language for converting given document types to Staircase document types. User can create own language from here: Language Product This language should contain 1-1 mapping between user document type and Staircase document type.

In Google Cloud platform type; there is an additional field called loan_ids. With this field; user can specify the loan ids that needs to imported in loan file path.

This API supports using batch configuration. Instead of inputting all required information; you can input "batch_id" and it will use the import configuration that given batch contains. Note that batch configuration will override the other input. Batch configuration can be created from here: Create Batch

The API will return an execution id for successful requests. To see the results use Get Operation Result

<!--/source-->

##### Request

<!--source:api-specifications-->
GoogleCloudGoogleCloudWithLoanIdsGoogleDriveSFTPSFTPClientBatch
<!--/source-->

<!--source:api-specifications-->
application/json Copy
```
{
 "platform": "google_cloud",
 "batch_info": {
 "import_classified_documents": true,
 "bucket_name": "test_bucket_staircase",
 "loan_file_path": "f2022-04-12/initial_onboarding_docs",
 "document_type_file_path": "f2022-04-12/output_docs/onboarding_input_document_tag_files",
 "document_type_mapping_language": "doctype_to_staircase"
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy
```
{
 "platform": "google_cloud",
 "batch_info": {
 "import_classified_documents": true,
 "bucket_name": "test_bucket_staircase",
 "loan_file_path": "f2022-04-12/initial_onboarding_docs",
 "document_type_file_path": "f2022-04-12/output_docs/onboarding_input_document_tag_files",
 "document_type_mapping_language": "doctype_to_staircase",
 "loan_ids": [
 1001,
 1002,
 1003
 ]
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy
```
{
 "platform": "google_drive",
 "batch_info": {
 "import_classified_documents": true,
 "folder_name": "test_folder",
 "loan_file_path": "loans",
 "document_type_file_path": "mappings",
 "document_type_mapping_language": "doctype_to_staircase"
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy
```
{
 "platform": "sftp",
 "batch_info": {
 "import_classified_documents": true,
 "user_name": "user",
 "loan_file_path": "example_batch_folder/loan_folder",
 "document_type_file_path": "example_batch_folder/mapping_folder",
 "document_type_mapping_language": "doctype_to_staircase"
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy
```
{
 "platform": "sftp_client",
 "batch_info": {
 "import_classified_documents": false,
 "loan_file_path": "example_batch_folder/loan_folder",
 "sftp_url": "sftp_server_url",
 "sftp_user_name": "sftp_user_name",
 "sftp_password": "sftp_password",
 "folder_name": "folder_name"
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy
```
{
 "batch_id": "01G3BC9MPZH4M0XQ45X6D1EA2V"
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
200400422
<!--/source-->

<!--source:api-specifications-->
application/json Copy Successfully returned status of import request

```
{
 "code": 200,
 "message": {
 "execution_id": "01G3BC9MPZH4M0XQ45X6D1EA2V"
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Request data failed validation

```
{
 "code": 400,
 "message": "Bad Request"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Unprocessed Entity

```
{
 "code": 422,
 "message": "Unprocessed Entity."
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `x-api-key` required | `string` header | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` | <!--source:api-specifications-->Environment API Key.<!--/source--> |

##### Request body`application/json`

<!--source:api-specifications-->
3 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `platform` | `string` | <!--source:api-specifications-->The platform where the loan documents exist<!--/source-->`google_cloud``google_drive``sftp``sftp_client` |
| `batch_info` | `object` | <!--source:api-specifications-->Information needed to import batch<!--/source--> |
| `bucket_name` | `string` | <!--source:api-specifications-->Google Cloud storage bucket name<!--/source--> |
| `loan_file_path` | `string` | <!--source:api-specifications-->The path of the folder that contains loan folders<!--/source--> |
| `doc_type_file_path` | `string` | <!--source:api-specifications-->The path of the folder that contains mapping files in CSV format<!--/source--> |
| `loan_ids` | `string[]` | <!--source:api-specifications-->If you only want to import specific loan ids, you can filter out rest of them with using this field<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Successfully returned status of import request
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `code` | `string` | <!--source:api-specifications-->Status code<!--/source--> |
| `message` | `object` | <!--source:api-specifications-->message<!--/source--> |
| `execution_id` | `string` | <!--source:api-specifications-->Execution id of the operation<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Request data failed validation
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unprocessed entity error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `422``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unprocessed Entity
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unprocessed entity error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

`POST` `/onboard`

<!--source:api-specifications-->

#### Onboard
<!--/source-->

`onboardLoan`

<!--source:api-specifications-->
Process a loan
<!--/source-->

<!--source:api-specifications-->
Onboard invokes an automated process that turns raw loan documents into onboarded loan data for mortgage servicing systems.

To invoke Onboard, you will need:

- For each loan, a transaction_id. The transaction_id needs to imported from a data source and must contain loan identifier information along with loan documents.
- If you want to use ml, the "ml_enabled" field should be true; otherwise set it to false.
- If you want to use labeling, "labeling_enabled" field should be true; otherwise set it to false.
- If you want to use Staircase Classification, "classify_enabled" field should be true; otherwise set it to false.
- For the "operation_type" field, select "extraction" and "classification_and_extraction"
- "delay_between_transactions" is an optional field and default delay time is 10 seconds. If you provide input for this field, Boarding will use this time value to create a delay between transactions.
- "fast_ml_option_enabled" is an optional field for ML product and default value is false. If it's true, it will use dedicated endpoints for ML
- "fields_to_label" is optional field for Labeling product to filter what should be on Labeling UI to label for given document type. For reviewing all available fields for labeling, you can check product overview: Overview

Once you have a transaction_id (or multiple transaction ids) which contains loan data, you can send them as part of the transaction_ids request body object.

Show the rest This API supports using batch configuration. Instead of inputting all required information; you can input "batch_id" and it will use the onboard configuration that given batch contains. Note that batch configuration will override the other input. Batch configuration can be created from here: Create Batch

Example input with extraction operation type:

```
{
 "transaction_ids": [
 "01FYXZWD3JE1ZX9J0MR35RC8XM"
 ],
 "request_payload": {
 "ml_enabled": true,
 "labeling_enabled": true,
 "operation_type": "extraction"
 }
 }
```

Example input with classification and extraction operation type, the user needs to select classification partner; available partners are ephesoft and documentai:

```
{
 "transaction_ids": [
 "01FYXZWD3JE1ZX9J0MR35RC8XM"
 ],
 "request_payload": {
 "selected_classification_partners": [
 "documentai",
 "ephesoft"
 ]
 "ml_enabled": true,
 "labeling_enabled": true,
 "classify_enabled": true,
 "operation_type": "classification_and_extraction"
 }
 }
```

Example input with batch_id:

```
{
 "transaction_ids": [
 "01FYXZWD3JE1ZX9J0MR35RC8XM"
 ],
 "batch_id": "batch_id"
 }
```

Example input with extraction operation type with fields_to_label:

```
{
 "transaction_ids": [
 "01FYXZWD3JE1ZX9J0MR35RC8XM"
 ],
 "request_payload": {
 "ml_enabled": true,
 "labeling_enabled": true,
 "operation_type": "extraction",
 "fields_to_label": {
 "bank_statement": [
 "Checking_Account_Checks_Paid",
 "Savings_Account_No",
 "Savings_Account_Name",
 "Savings_Account_Deposits_And_Additions",
 "Checking_Account_Fees"
 ]
 }
 }
 }
```

View the status of the onboarded transactions using Status.

<!--/source-->

##### Request

<!--source:api-specifications-->
ExtractionExampleClassificationExtractionExampleBatchIdExampleExtractionExampleWithFieldsToLabel
<!--/source-->

<!--source:api-specifications-->
application/json Copy
```
{
 "transaction_ids": [
 "01FYXZWD3JE1ZX9J0MR35RC8XM"
 ],
 "request_payload": {
 "ml_enabled": true,
 "labeling_enabled": false,
 "operation_type": "extraction"
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy
```
{
 "transaction_ids": [
 "01FYXZWD3JE1ZX9J0MR35RC8XM"
 ],
 "request_payload": {
 "ml_enabled": true,
 "labeling_enabled": false,
 "classify_enabled": false,
 "operation_type": "classification_and_extraction",
 "selected_classification_partners": [
 "ephesoft"
 ]
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy
```
{
 "transaction_ids": [
 "01FYXZWD3JE1ZX9J0MR35RC8XM"
 ],
 "batch_id": "batch_id"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy
```
{
 "transaction_ids": [
 "01GGCT4ZZRSSDXD5SS8F0522CB"
 ],
 "request_payload": {
 "delay_between_transactions": 15,
 "ml_enabled": false,
 "labeling_enabled": true,
 "operation_type": "extraction",
 "fields_to_label": {
 "bank_statement": [
 "Checking_Account_Checks_Paid",
 "Savings_Account_No",
 "Savings_Account_Name",
 "Savings_Account_Deposits_And_Additions",
 "Checking_Account_Fees"
 ]
 }
 }
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
400422
<!--/source-->

<!--source:api-specifications-->
application/json Copy Request data failed validation

```
{
 "code": 400,
 "message": "Bad Request"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Unprocessed Entity

```
{
 "code": 422,
 "message": "Unprocessed Entity."
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `x-api-key` required | `string` header | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` | <!--source:api-specifications-->Environment API Key.<!--/source--> |

##### Request body`application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `transaction_ids` | `string[]` | <!--source:api-specifications-->Transaction IDs for the loans that you imported and want to onboard<!--/source--> |
| `request_payload` | `object` | <!--source:api-specifications-->Request payload for onboard<!--/source--> |
| `delay_between_transactions` | `integer` | <!--source:api-specifications-->Delay information<!--/source--> |
| `ml_enabled` | `boolean` | <!--source:api-specifications-->ML information<!--/source--> |
| `labeling_enabled` | `boolean` | <!--source:api-specifications-->Labeling information<!--/source--> |
| `classify_enabled` | `boolean` | <!--source:api-specifications-->Staircase classification information<!--/source--> |
| `automatic_training_enabled` | `boolean` | <!--source:api-specifications-->Automatic training information<!--/source--> |
| `operation_type` | `string` | <!--source:api-specifications-->Operation type selection<!--/source-->`classification_and_extraction``extraction` |
| `selected_classification_partners` | `string[]` | <!--source:api-specifications-->Selected classification partners<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Response collection
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Onboard result message<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Request data failed validation
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unprocessed entity error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `422``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unprocessed Entity
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unprocessed entity error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

`POST` `/export`

<!--source:api-specifications-->

#### Export
<!--/source-->

`exportLoan`

<!--source:api-specifications-->
Export a loan
<!--/source-->

<!--source:api-specifications-->
Export requires one or more onboarded loan transaction_id's as input, and converts them from Staircase data to customer data, for subsequent delivery to a customer environment.

To invoke Export, you will need a transaction_id for each loan. Before exporting a loan transaction, make sure that it has been onboarded and has an onboarding result. A transaction should be processed by /onboard before it is exported.

Show the rest Once you have a transaction_id (or multiple transaction_id's) which contains onboard data, add them to the request body to export them. In export operation:

- "ruleset_name" is an optional field for applying rules to boarding result. User can create own rules from here: Rule Product Or user can apply default rules that has been provided with "default_rules" ruleset name. You can download detailed information in Overview page.
- "language_name" is an optional field for translating from Staircase v2 language to given user language. User can create own language from here: Language Product

This API supports using batch configuration. Instead of inputting all information; you can input "batch_id" and it will use the export configuration that given batch contains. Note that batch configuration will override the other input. Batch configuration can be created from here: Create Batch

Examples:

```
{
"transaction_ids": [
"01FYXZWD3JE1ZX9J0MR35RC8XM"
]
}
```

```
{
"transaction_ids": [
"01FYXZWD3JE1ZX9J0MR35RC8XM"
],
"request_payload": {
"ruleset_name": "default_rules"
"language_name": "language_name"
}
}
```

```
{
"transaction_ids": [
"01FYXZWD3JE1ZX9J0MR35RC8XM"
],
"batch_id": "batch_id"
}
```

The endpoint will return an execution id for successful requests. To see the results use Get Operation Result

<!--/source-->

##### Request

<!--source:api-specifications-->
ExampleWithRulesetAndLanguageExampleWithBatchId
<!--/source-->

<!--source:api-specifications-->
application/json Copy
```
{
 "transaction_ids": [
 "01FYXZWD3JE1ZX9J0MR35RC8XM"
 ],
 "request_payload": {
 "ruleset_name": "default_rules",
 "language_name": "language_name"
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy
```
{
 "transaction_ids": [
 "01FYXZWD3JE1ZX9J0MR35RC8XM"
 ],
 "batch_id": "01G3BC9MPZH4M0XQ45X6D1EA2V"
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
200400422
<!--/source-->

<!--source:api-specifications-->
application/json Copy Successfully returned export request

```
{
 "code": 200,
 "message": {
 "execution_id": "01G23BGPVAP4YEH0KY2K8M9GR7"
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Request data failed validation

```
{
 "code": 400,
 "message": "Bad Request"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Unprocessed Entity

```
{
 "code": 422,
 "message": "Unprocessed Entity."
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `x-api-key` required | `string` header | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` | <!--source:api-specifications-->Environment API Key.<!--/source--> |

##### Request body`application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `transaction_ids` | `string[]` | <!--source:api-specifications-->Transaction_ids for loans which are going to be resumed<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Successfully returned export request
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `code` | `number` | <!--source:api-specifications-->Status code<!--/source--> |
| `message` | `object` | <!--source:api-specifications-->Message<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Request data failed validation
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unprocessed entity error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `422``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unprocessed Entity
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unprocessed entity error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

`POST` `/status`

<!--source:api-specifications-->

#### Status
<!--/source-->

`status`

<!--source:api-specifications-->
Get status of the loans in onboard process
<!--/source-->

<!--source:api-specifications-->
Check the onboarding status of a loan at any point in the process, by using the loan transaction id which was returned after performing the onboard operation.

This API supports using batch configuration. Instead of inputting transaction ids; you can input "batch_id" and it will use the registered transactions in the batch. Note that batch configuration will override the other input. Transactions can be registered to the batch from here: Register Transactions to Batch

The API will return an execution_id for successful requests. To see the results, use Get Operation Result until it's `message.status` is SUCCEEDED.

<!--/source-->

##### Request

<!--source:api-specifications-->
application/json Copy
```
{
 "transaction_ids": [
 "01G394T6AP0F0XY7ER5TAY1YH4",
 "01G23BF87W7W5HKFYEMQAETNZG",
 "01G23BGR0K6S5XESPHPZXWB1ZJ",
 "01G23BGPVAP4YEH0KY2K8M9GR7"
 ]
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
200400422
<!--/source-->

<!--source:api-specifications-->
application/json Copy Successfully returned status request

```
{
 "code": 200,
 "message": {
 "execution_id": "01G23BGPVAP4YEH0KY2K8M9GR7"
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Request data failed validation

```
{
 "code": 400,
 "message": "Bad Request"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Unprocessed Entity

```
{
 "code": 422,
 "message": "Unprocessed Entity."
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `x-api-key` required | `string` header | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` | <!--source:api-specifications-->Environment API Key.<!--/source--> |

##### Request body`application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `transaction_ids` | `string[]` | <!--source:api-specifications-->Loan transaction_id list whose statuses are going to be provided<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Successfully returned status request
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `code` | `number` | <!--source:api-specifications-->Status code<!--/source--> |
| `message` | `object` | <!--source:api-specifications-->Message<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Request data failed validation
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unprocessed entity error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `422``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unprocessed Entity
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unprocessed entity error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

`POST` `/deliver`

<!--source:api-specifications-->

#### Deliver
<!--/source-->

`deliver`

<!--source:api-specifications-->
Deliver processed loans to a customer environment
<!--/source-->

<!--source:api-specifications-->
After a loan is exported, it is ready to be delivered to a customer environment. With this API, user can deliver exported result to given destination. Boarding currently supports delivery to Google Cloud storage, Staircase SFTP and SFTP Client.

You can see the status of the transactions that you delivered using Status.

This API supports using batch configuration. Instead of inputting all required information; you can input "batch_id" and it will use the delivery configuration that given batch contains. Note that batch configuration will override the other input. Batch configuration can be created from here: Create Batch

<!--/source-->

##### Request

<!--source:api-specifications-->
GoogleCloudExampleBatchExample
<!--/source-->

<!--source:api-specifications-->
application/json Copy
```
{
 "transaction_ids": [
 "01G394T6AP0F0XY7ER5TAY1YH4"
 ],
 "request_payload": {
 "bucket_name": "test_bucket_staircase",
 "result_file_path": "batch_folder/result",
 "mime_type": "application_json"
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy
```
{
 "transaction_ids": [
 "01G394T6AP0F0XY7ER5TAY1YH4"
 ],
 "batch_id": "01G3BC9MPZH4M0XQ45X6D1EA2V"
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
200400422
<!--/source-->

<!--source:api-specifications-->
application/json Copy Successfully returned status of import request

```
{
 "code": 200,
 "message": "Deliver operation has started for the loan outputs"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Request data failed validation

```
{
 "code": 400,
 "message": "Bad Request"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Unprocessed Entity

```
{
 "code": 422,
 "message": "Unprocessed Entity."
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `x-api-key` required | `string` header | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` | <!--source:api-specifications-->Environment API Key.<!--/source--> |

##### Request body`application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `transaction_ids` | `string[]` | <!--source:api-specifications-->id of transactions for the loans that you are going to deliver<!--/source--> |
| `request_payload` | `object` | <!--source:api-specifications-->Information needed to deliver boarding result<!--/source--> |
| `bucket_name` | `string` | <!--source:api-specifications-->The Google Cloud storage bucket to which the results are going to be delivered<!--/source--> |
| `user_name` | `string` | <!--source:api-specifications-->Username for SFTP server, this field should be provided if platform is SFTP<!--/source--> |
| `loan_file_path` | `string` | <!--source:api-specifications-->The path of the folder where the results are going to be delivered<!--/source--> |
| `mime_type` | `string` | <!--source:api-specifications-->The type of result files that are going to be delivered<!--/source-->`application_json``application_ld_json``application_xml` |
| `platform` | `string` | <!--source:api-specifications-->The platform that the results are going to be delivered<!--/source-->`google_cloud``google_drive``sftp``sftp_client` |

##### Response `200``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Successfully returned status of import request
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `code` | `string` | <!--source:api-specifications-->Status code<!--/source--> |
| `message` | `string` | <!--source:api-specifications-->Message<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Request data failed validation
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unprocessed entity error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `422``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unprocessed Entity
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unprocessed entity error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

`POST` `/query`

<!--source:api-specifications-->

#### Query
<!--/source-->

`query`

<!--source:api-specifications-->
Get loan id of the loans
<!--/source-->

<!--source:api-specifications-->
Query provides loan id information and document count for one or more loans. The API will return an execution_id for successful requests. To see the results, use Get Operation Result.

Example result:

```
{
 "code": 202,
 "message": {
 "start_date": "2022-05-27 13:07:06",
 "stop_date": "2022-05-27 13:07:10",
 "status": "SUCCEEDED",
 "data": {
 "loans": [
 {
 "transaction_id": "01G406KR4KR5K8DVWJW59XYQYC",
 "loan_id": "100001"
 "document_count": 10
 },
 {
 "transaction_id": "01G406KJFV21RGN69X4H1C8TBM",
 "loan_id": "100002"
 "document_count": 20
 },
 {
 "transaction_id": "01G406KKHNE52KCVZN9WKMSPZ2",
 "loan_id": "100003"
 "document_count": 30
 }
 ]
 }
 }
}
```

<!--/source-->

##### Request

<!--source:api-specifications-->
application/json Copy
```
{
 "transaction_ids": [
 "01G394T6AP0F0XY7ER5TAY1YH4",
 "01G23BF87W7W5HKFYEMQAETNZG",
 "01G23BGR0K6S5XESPHPZXWB1ZJ",
 "01G23BGPVAP4YEH0KY2K8M9GR7"
 ]
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
200400422
<!--/source-->

<!--source:api-specifications-->
application/json Copy Successfully returned status of query request

```
{
 "code": 200,
 "message": {
 "response_collection_id": "01G23BGPVAP4YEH0KY2K8M9GR7"
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Request data failed validation

```
{
 "code": 400,
 "message": "Bad Request"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Unprocessed Entity

```
{
 "code": 422,
 "message": "Unprocessed Entity."
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `x-api-key` required | `string` header | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` | <!--source:api-specifications-->Environment API Key.<!--/source--> |

##### Request body`application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `transaction_ids` | `string[]` | <!--source:api-specifications-->Transaction id list of loans to be queried<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Successfully returned status of query request
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `code` | `number` | <!--source:api-specifications-->Status code<!--/source--> |
| `message` | `object` | <!--source:api-specifications-->Message<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Request data failed validation
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unprocessed entity error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `422``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unprocessed Entity
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unprocessed entity error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

`POST` `/{transaction_id}/status`

<!--source:api-specifications-->

#### Transaction Status
<!--/source-->

`transactionStatus`

<!--source:api-specifications-->
Checking transaction status with document details
<!--/source-->

<!--source:api-specifications-->
Transaction Status provides the status for each document in a transaction. Statuses include GTL_EXTRACTION_COMPLETED, TRAIN_EXTRACTION_COMPLETED, COULD NOT FIND TRAIN OR GTL RESULT FOR THIS DOCUMENT. This API requires a transaction_id in the request and returns an execution_id for successful requests. To see the results, use Get Operation Result.

Example transaction status result:

Show the rest
```
"message": {
"start_date": "2022-06-10 07:43:15",
"stop_date": "2022-06-10 07:43:23",
"status": "SUCCEEDED",
"data": [
{
"document_name": "test_note.pdf",
"created_at": "2022-05-31T19:50:10.161363-04:00",
"status": "GTL_EXTRACTION_COMPLETED",
"last_updated_at": "2022-06-03T04:47:53.041720-04:00"
},
{
"document_name": "test_appraisal.pdf",
"created_at": "2022-05-31T19:50:05.323109-04:00",
"status": "GTL_EXTRACTION_COMPLETED",
"last_updated_at": "2022-06-01T07:55:20.965616-04:00"
},
{
"document_name": "test_w2.pdf",
"created_at": "2022-05-31T19:50:13.886317-04:00",
"status": "GTL_EXTRACTION_COMPLETED",
"last_updated_at": "2022-06-01T00:40:17.638374-04:00"
}
]
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
200400422
<!--/source-->

<!--source:api-specifications-->
application/json Copy Successfully returned status of transaction status request

```
{
 "code": 200,
 "message": {
 "execution_id": "01G3BC9MPZH4M0XQ45X6D1EA2V"
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Request data failed validation

```
{
 "code": 400,
 "message": "Bad Request"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Unprocessed Entity

```
{
 "code": 422,
 "message": "Unprocessed Entity."
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
2
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `x-api-key` required | `string` header | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` | <!--source:api-specifications-->Environment API Key.<!--/source--> |
| `transaction_id` required | `string` path | `01G4CPJSW76SWNW88CN907KNZF` | <!--source:api-specifications-->Transaction id<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Successfully returned status of transaction status request
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `code` | `string` | <!--source:api-specifications-->Status code<!--/source--> |
| `message` | `object` | <!--source:api-specifications-->message<!--/source--> |
| `execution_id` | `string` | <!--source:api-specifications-->Execution id of the operation<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Request data failed validation
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unprocessed entity error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `422``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unprocessed Entity
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unprocessed entity error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

`GET` `/operations/{operation_name}/executions/{execution_id}`

<!--source:api-specifications-->

#### Operation Result
<!--/source-->

`operationResult`

<!--source:api-specifications-->
Get execution results of boarding operations
<!--/source-->

<!--source:api-specifications-->
The following boarding operations return execution id:

- /import
- /status
- /query
- /{transaction_id}/status

When executing the API with `execution_id` and the `operation_name` you will receive a response that with status RUNNING or SUCCEEDED. If it's still RUNNING please query it till you get a `message.status` = `SUCCEEDED`.

<!--/source-->

##### Response

<!--source:api-specifications-->
200 StatusSucceeded200 QuerySucceeded200 StatusRunning200 StatusInML200 ImportSucceeded400422
<!--/source-->

<!--source:api-specifications-->
application/json Copy Successfully fetched operation result

```
{
 "code": 200,
 "message": {
 "transactions": [
 {
 "transaction_id": "01GAR1889DFA56FCQVBWT8DTPM",
 "transaction_created_at": "2022-08-18T04:31:25.537694-04:00",
 "onboarding_status": "ONBOARDING_COMPLETED",
 "status_updated_at": "2022-08-18T06:13:25.219153-04:00"
 }
 ]
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Successfully fetched operation result

```
{
 "code": 202,
 "message": {
 "start_date": "2022-05-27 13:07:06",
 "stop_date": "2022-05-27 13:07:10",
 "status": "SUCCEEDED",
 "data": {
 "loans": [
 {
 "transaction_id": "01G406KR4KR5K8DVWJW59XYQTS",
 "loan_id": "101101"
 }
 ]
 }
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Successfully fetched operation result

```
{
 "code": 200,
 "message": {
 "start_date": "2022-08-31 23:44:15",
 "status": "RUNNING"
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Successfully fetched operation result

```
{
 "code": 200,
 "message": {
 "start_date": "2022-08-31T20:15:46.588000-04:00",
 "stop_date": "2022-08-31T20:16:08.246000-04:00",
 "status": "SUCCEEDED",
 "data": {
 "transactions": [
 {
 "transaction_id": {
 "transaction_id": "01GBTQX9PPY7XET65RMXAANGMT",
 "transaction_created_at": "2022-08-31T16:01:35.336279-04:00",
 "onboarding_status": "IN_ML",
 "status_updated_at": "2022-08-31T16:19:16.638650-04:00"
 }
 }
 ]
 }
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Successfully fetched operation result

```
{
 "code": 202,
 "message": {
 "start_date": "2022-05-27 11:57:51",
 "stop_date": "2022-05-27 11:58:37",
 "status": "SUCCEEDED",
 "data": {
 "transaction_ids": [
 "01G42P3K5YNKJQVCEBHA14E3XD",
 "01G42P3JYZYS5EK2WHPA8Y07AG"
 ],
 "errors": [
 null
 ]
 }
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Request data failed validation

```
{
 "code": 400,
 "message": "Bad Request"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Unprocessed Entity

```
{
 "code": 422,
 "message": "Unprocessed Entity."
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
3
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `operation_name` required | `string` path | `import` | <!--source:api-specifications-->Operation name<!--/source--> |
| `execution_id` required | `string` path | `01G42T1CQ7TKF14MPW6NA840FM` | <!--source:api-specifications-->Execution Id<!--/source--> |
| `x-api-key` required | `string` header | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` | <!--source:api-specifications-->Environment API Key.<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Successfully fetched operation result
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `code` | `number` | <!--source:api-specifications-->Status code<!--/source--> |
| `message` | `object` | <!--source:api-specifications-->Message<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Request data failed validation
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unprocessed entity error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `422``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unprocessed Entity
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unprocessed entity error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

<!--source:api-specifications-->

### Batch Configuration
<!--/source-->

`POST` `/batches`

<!--source:api-specifications-->

#### Create Batch
<!--/source-->

`createBatch`

<!--source:api-specifications-->
With this API user can create a batch object that may contain information for whole boarding process: import, onboard, export, delivery and general batch information.

<!--/source-->

##### Request

<!--source:api-specifications-->
application/json Copy
```
{
 "import_configuration": {
 "platform": "google_drive",
 "folder_name": "folder_name",
 "loan_file_path": "abc/def",
 "import_classified_documents": true,
 "document_type_file_path": "abc/def/ghj",
 "document_type_mapping_language": "test",
 "bucket_name": "bucket_name",
 "user_name": "user_name",
 "sftp_user_name": "sftp_user_name",
 "sftp_password": "sftp_password",
 "sftp_url": "sftp_url"
 },
 "onboard_configuration": {
 "operation_type": "extraction",
 "ml_enabled": true,
 "labeling_enabled": false,
 "classify_enabled": true,
 "selected_classification_partners": [
 "ephesoft"
 ],
 "delay_between_transactions": 10,
 "automatic_training_enabled": false,
 "fast_ml_option_enabled": true,
 "fields_to_label": {
 "bank_statement": [
 "Checking_Account_Checks_Paid",
 "Savings_Account_No",
 "Savings_Account_Name",
 "Savings_Account_Deposits_And_Additions",
 "Checking_Account_Fees"
 ]
 }
 },
 "export_configuration": {
 "ruleset_name": "ruleset_name",
 "language_name": "language_name"
 },
 "delivery_configuration": {
 "platform": "google_drive",
 "mime_type": "mime_type",
 "result_file_path": "result_file_path",
 "folder_name": "folder_name",
 "bucket_name": "bucket_name",
 "user_name": "user_name",
 "sftp_user_name": "sftp_user_name",
 "sftp_password": "sftp_password",
 "sftp_url": "sftp_url"
 },
 "batch_information": {
 "loan_count": 1000,
 "register_date": "22/10/2022",
 "start_date": "22/10/2022",
 "completion_date": "22/10/2022",
 "daily_quota": 20,
 "daily_labeler_count": 10
 }
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
200400422
<!--/source-->

<!--source:api-specifications-->
application/json Copy Successfully created batch id

```
{
 "code": 200,
 "message": {
 "batch_id": "01G23BGPVAP4YEH0KY2K8M9GR7"
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Request data failed validation

```
{
 "code": 400,
 "message": "Bad Request"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Unprocessed Entity

```
{
 "code": 422,
 "message": "Unprocessed Entity."
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `x-api-key` required | `string` header | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` | <!--source:api-specifications-->Environment API Key.<!--/source--> |

##### Request body`application/json`

<!--source:api-specifications-->
5 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `import_configuration` | `object` | <!--source:api-specifications-->Import configuration object<!--/source--> |
| `platform` | `string` | <!--source:api-specifications-->The platform where the loan documents exist<!--/source-->`google_cloud``google_drive``sftp``sftp_client` |
| `folder_name` | `string` | <!--source:api-specifications-->Folder_name for Google Drive<!--/source--> |
| `loan_file_path` | `string` | <!--source:api-specifications-->Loan location<!--/source--> |
| `import_classified_documents` | `boolean` | <!--source:api-specifications-->Indicator for classified loan information<!--/source--> |
| `document_type_file_path` | `string` | <!--source:api-specifications-->Location for document type information<!--/source--> |
| `document_type_mapping_language` | `string` | <!--source:api-specifications-->Language name for document type mapping<!--/source--> |
| `bucket_name` | `string` | <!--source:api-specifications-->Bucket name for Google Cloud<!--/source--> |
| `user_name` | `string` | <!--source:api-specifications-->Username for Staircase SFTP server login<!--/source--> |
| `sftp_user_name` | `string` | <!--source:api-specifications-->Username for Staircase SFTP client login<!--/source--> |
| `sftp_password` | `string` | <!--source:api-specifications-->Password for Staircase SFTP client login<!--/source--> |
| `sftp_url` | `string` | <!--source:api-specifications-->URL for Staircase SFTP client login<!--/source--> |
| `onboard_configuration` | `object` | <!--source:api-specifications-->Onboard configuration object<!--/source--> |
| `operation_type` | `string` | <!--source:api-specifications-->Operation type<!--/source--> |
| `ml_enabled` | `boolean` | <!--source:api-specifications-->Indicator for enabling/disabling ML in onboard operation<!--/source--> |
| `labeling_enabled` | `boolean` | <!--source:api-specifications-->Indicator for enabling/disabling labeling in onboard operation<!--/source--> |
| `classify_enabled` | `boolean` | <!--source:api-specifications-->Indicator for enabling/disabling Staircase Classification in onboard operation<!--/source--> |
| `selected_classification_partners` | `array` | <!--source:api-specifications-->Array for selected partners for classification<!--/source--> |
| `delay_between_transactions` | `integer` | <!--source:api-specifications-->Delay seconds between loans in onboarding<!--/source--> |
| `automatic_training_enabled` | `boolean` | <!--source:api-specifications-->Indicator for enabling/disabling auto-training for ML in onboard operation<!--/source--> |
| `fast_ml_option_enabled` | `boolean` | <!--source:api-specifications-->Indicator for enabling/disabling dedicated endpoints for ML in onboard operation<!--/source--> |
| `fields_to_label` | `array` | <!--source:api-specifications-->Array for fields to label<!--/source--> |
| `export_configuration` | `object` | <!--source:api-specifications-->Export configuration object<!--/source--> |
| `ruleset_name` | `string` | <!--source:api-specifications-->Ruleset name for applying rules<!--/source--> |
| `language_name` | `string` | <!--source:api-specifications-->Language name for applying rules<!--/source--> |
| `delivery_configuration` | `object` | <!--source:api-specifications-->Delivery configuration object<!--/source--> |
| `platform` | `string` | <!--source:api-specifications-->The platform where the loan documents exist<!--/source-->`google_cloud``google_drive``sftp``sftp_client` |
| `mime_type` | `string` | <!--source:api-specifications-->Mime type for to be delivered document<!--/source-->`application_json``application_ld_json``application_xml` |
| `result_file_path` | `string` | <!--source:api-specifications-->Location for delivery<!--/source--> |
| `folder_name` | `string` | <!--source:api-specifications-->Folder name for Google Drive<!--/source--> |
| `bucket_name` | `string` | <!--source:api-specifications-->Bucket name for Google Cloud<!--/source--> |
| `user_name` | `string` | <!--source:api-specifications-->Username for Staircase SFTP server login<!--/source--> |
| `sftp_user_name` | `string` | <!--source:api-specifications-->Username for Staircase SFTP client login<!--/source--> |
| `sftp_password` | `string` | <!--source:api-specifications-->Password for Staircase SFTP client login<!--/source--> |
| `sftp_url` | `string` | <!--source:api-specifications-->URL for Staircase SFTP client login<!--/source--> |
| `batch_information` | `object` | <!--source:api-specifications-->Batch information object<!--/source--> |
| `loan_count` | `integer` | <!--source:api-specifications-->Loan count in the batch<!--/source--> |
| `register_date` | `string` | <!--source:api-specifications-->The date that loans are registered<!--/source--> |
| `start_date` | `string` | <!--source:api-specifications-->The date that boarding operation started<!--/source--> |
| `completion_date` | `string` | <!--source:api-specifications-->The date that boarding operation completed<!--/source--> |
| `daily_quota` | `integer` | <!--source:api-specifications-->Daily quota for completed loans<!--/source--> |
| `daily_labeler_count` | `integer` | <!--source:api-specifications-->Labeler counts that works on the process<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Successfully created batch id
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `code` | `number` | <!--source:api-specifications-->Status code<!--/source--> |
| `message` | `object` | <!--source:api-specifications-->Message<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Request data failed validation
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unprocessed entity error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `422``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unprocessed Entity
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unprocessed entity error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

`GET` `/batches/{batch_id}`

<!--source:api-specifications-->

#### Retrieve Batch
<!--/source-->

`retrieveBatch`

<!--source:api-specifications-->
Get batch configuration
<!--/source-->

<!--source:api-specifications-->
With this API, the batch configuration can be retrieved with given batch id

<!--/source-->

##### Response

<!--source:api-specifications-->
200400422
<!--/source-->

<!--source:api-specifications-->
application/json Copy Successfully retrieved batch

```
{
 "import_configurations": [
 {
 "has_platform_type": null,
 "has_value": "google_drive",
 "has_folder_name": {
 "has_value": "folder_name"
 },
 "has_file_path": {
 "has_value": "abc/def"
 },
 "has_import_classified_documents_indicator": {
 "has_value": true
 },
 "document_type_file_path": {
 "has_value": "abc/def/ghj"
 },
 "has_document_type_mapping_language": {
 "has_value": "test"
 },
 "has_bucket_name": {
 "has_value": "bucket_name"
 },
 "has_user_name": {
 "has_value": "user_name"
 },
 "has_sftp_user_name": {
 "has_value": "sftp_user_name"
 },
 "has_sftp_password": {
 "has_value": "sftp_password"
 },
 "has_sftp_server_url": {
 "has_value": "sftp_url"
 },
 "@type": "import_configuration",
 "@id": "01GF87MAY70RA11JT8ZZCRG7DE"
 }
 ],
 "classification_partners": [
 {
 "@type": "classification_partner",
 "@id": "01GF87MAY7EV6AE4NW9BKQWR9G",
 "has_classification_partner_type": {
 "has_value": "ephesoft"
 }
 }
 ],
 "onboard_configurations": [
 {
 "has_operation_type": {
 "has_value": "extraction"
 },
 "has_ml_enabled_indicator": {
 "has_value": true
 },
 "has_labeling_enabled_indicator": {
 "has_value": false
 },
 "has_delay_between_transactions_seconds": {
 "has_value": 10
 },
 "has_automatic_training_enabled_indicator": {
 "has_value": false
 },
 "has_fast_ml_option_enabled_indicator": {
 "has_value": true
 },
 "@type": "onboard_configuration",
 "@id": "01GF87MAY7VQFAAKJVGKAYN648",
 "with_classification_partner": [
 "01GF87MAY7EV6AE4NW9BKQWR9G"
 ]
 }
 ],
 "export_configurations": [
 {
 "has_ruleset_name": {
 "has_value": "ruleset_name"
 },
 "has_language_name": {
 "has_value": "language_name"
 },
 "@type": "export_configuration",
 "@id": "01GF87MAY7MM8TZWHFZHDN5A9W"
 }
 ],
 "delivery_configurations": [
 {
 "has_platform_type": {
 "has_value": "google_drive"
 },
 "has_mime_type": {
 "has_value": "mime_type"
 },
 "has_file_path": {
 "has_value": "result_file_path"
 },
 "has_folder_name": {
 "has_value": "folder_name"
 },
 "has_bucket_name": {
 "has_value": "bucket_name"
 },
 "has_user_name": {
 "has_value": "user_name"
 },
 "has_sftp_user_name": {
 "has_value": "sftp_user_name"
 },
 "has_sftp_password": {
 "has_value": "sftp_password"
 },
 "has_sftp_server_url": {
 "has_value": "sftp_url"
 },
 "@type": "delivery_configuration",
 "@id": "01GF87MAY7MVW7Q5K4VX42GD85"
 }
 ],
 "batch_informations": [
 {
 "has_loan_count": {
 "has_value": 1000
 },
 "has_register_date": {
 "has_value": "22/10/2022"
 },
 "has_start_date": {
 "has_value": "22/10/2022"
 },
 "has_completion_date": {
 "has_value": "22/10/2022"
 },
 "has_daily_quota_count": {
 "has_value": 20
 },
 "has_daily_labeler_count": {
 "has_value": 10
 },
 "@type": "batch_information",
 "@id": "01GF87MAY70MAESV359HRTVCP6"
 }
 ],
 "loan_boarding_batches": [
 {
 "with_import_configuration": [
 "01GF87MAY70RA11JT8ZZCRG7DE"
 ],
 "with_onboard_configuration": [
 "01GF87MAY7VQFAAKJVGKAYN648"
 ],
 "with_export_configuration": [
 "01GF87MAY7MM8TZWHFZHDN5A9W"
 ],
 "with_delivery_configuration": [
 "01GF87MAY7MVW7Q5K4VX42GD85"
 ],
 "with_batch_information": [
 "01GF87MAY70MAESV359HRTVCP6"
 ],
 "@type": "loan_boarding_batch",
 "@id": "01GF87MAY7JMNN9Y60BD5C14ND"
 }
 ]
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Request data failed validation

```
{
 "code": 400,
 "message": "Bad Request"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Unprocessed Entity

```
{
 "code": 422,
 "message": "Unprocessed Entity."
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
2
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `batch_id` required | `string` path | `01G42T1CQ7TKF14MPW6NA840FM` | <!--source:api-specifications-->Batch Id<!--/source--> |
| `x-api-key` required | `string` header | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` | <!--source:api-specifications-->Environment API Key.<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Successfully retrieved batch
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `code` | `number` | <!--source:api-specifications-->Status code<!--/source--> |
| `message` | `object` | <!--source:api-specifications-->Message<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Request data failed validation
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unprocessed entity error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `422``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unprocessed Entity
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unprocessed entity error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

`PUT` `/batches/{batch_id}`

<!--source:api-specifications-->

#### Update Batch
<!--/source-->

`updateBatch`

<!--source:api-specifications-->
With this API user can update the batch object that may contain information for whole boarding process: import, onboard, export, delivery and general batch information.

<!--/source-->

##### Request

<!--source:api-specifications-->
application/json Copy
```
{
 "import_configuration": {
 "platform": "google_drive",
 "folder_name": "folder_name",
 "loan_file_path": "abc/def",
 "import_classified_documents": true,
 "document_type_file_path": "abc/def/ghj",
 "document_type_mapping_language": "test",
 "bucket_name": "bucket_name",
 "user_name": "user_name",
 "sftp_user_name": "sftp_user_name",
 "sftp_password": "sftp_password",
 "sftp_url": "sftp_url"
 },
 "onboard_configuration": {
 "operation_type": "extraction",
 "ml_enabled": true,
 "labeling_enabled": false,
 "selected_classification_partners": [
 "ephesoft"
 ],
 "delay_between_transactions": 10,
 "automatic_training_enabled": false,
 "fast_ml_option_enabled": true
 },
 "export_configuration": {
 "ruleset_name": "ruleset_name",
 "language_name": "language_name"
 },
 "delivery_configuration": {
 "platform": "google_drive",
 "mime_type": "mime_type",
 "result_file_path": "result_file_path",
 "folder_name": "folder_name",
 "bucket_name": "bucket_name",
 "user_name": "user_name",
 "sftp_user_name": "sftp_user_name",
 "sftp_password": "sftp_password",
 "sftp_url": "sftp_url"
 },
 "batch_information": {
 "loan_count": 1000,
 "register_date": "22/10/2022",
 "start_date": "22/10/2022",
 "completion_date": "22/10/2022",
 "daily_quota": 20,
 "daily_labeler_count": 10
 }
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
200400422
<!--/source-->

<!--source:api-specifications-->
application/json Copy Successfully updated batch id

```
{
 "code": 200,
 "message": {
 "batch_id": "01G23BGPVAP4YEH0KY2K8M9GR7"
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Request data failed validation

```
{
 "code": 400,
 "message": "Bad Request"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Unprocessed Entity

```
{
 "code": 422,
 "message": "Unprocessed Entity."
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
2
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `batch_id` required | `string` path | `01G42T1CQ7TKF14MPW6NA840FM` | <!--source:api-specifications-->Batch Id<!--/source--> |
| `x-api-key` required | `string` header | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` | <!--source:api-specifications-->Environment API Key.<!--/source--> |

##### Request body`application/json`

<!--source:api-specifications-->
5 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `import_configuration` | `object` | <!--source:api-specifications-->Import configuration object<!--/source--> |
| `platform` | `string` | <!--source:api-specifications-->The platform where the loan documents exist<!--/source-->`google_cloud``google_drive``sftp``sftp_client` |
| `folder_name` | `string` | <!--source:api-specifications-->Folder_name for Google Drive<!--/source--> |
| `loan_file_path` | `string` | <!--source:api-specifications-->Loan location<!--/source--> |
| `import_classified_documents` | `boolean` | <!--source:api-specifications-->Indicator for classified loan information<!--/source--> |
| `document_type_file_path` | `string` | <!--source:api-specifications-->Location for document type information<!--/source--> |
| `document_type_mapping_language` | `string` | <!--source:api-specifications-->Language name for document type mapping<!--/source--> |
| `bucket_name` | `string` | <!--source:api-specifications-->Bucket name for Google Cloud<!--/source--> |
| `user_name` | `string` | <!--source:api-specifications-->Username for Staircase SFTP server login<!--/source--> |
| `sftp_user_name` | `string` | <!--source:api-specifications-->Username for Staircase SFTP client login<!--/source--> |
| `sftp_password` | `string` | <!--source:api-specifications-->Password for Staircase SFTP client login<!--/source--> |
| `sftp_url` | `string` | <!--source:api-specifications-->URL for Staircase SFTP client login<!--/source--> |
| `onboard_configuration` | `object` | <!--source:api-specifications-->Onboard configuration object<!--/source--> |
| `operation_type` | `string` | <!--source:api-specifications-->Operation type<!--/source--> |
| `ml_enabled` | `boolean` | <!--source:api-specifications-->Indicator for enabling/disabling ML in onboard operation<!--/source--> |
| `labeling_enabled` | `boolean` | <!--source:api-specifications-->Indicator for enabling/disabling labeling in onboard operation<!--/source--> |
| `selected_classification_partners` | `array` | <!--source:api-specifications-->Array for selected partners for classification<!--/source--> |
| `delay_between_transactions` | `integer` | <!--source:api-specifications-->Delay seconds between loans in onboarding<!--/source--> |
| `automatic_training_enabled` | `boolean` | <!--source:api-specifications-->Indicator for enabling/disabling auto-training for ML in onboard operation<!--/source--> |
| `fast_ml_option_enabled` | `boolean` | <!--source:api-specifications-->Indicator for enabling/disabling dedicated endpoints for ML in onboard operation<!--/source--> |
| `export_configuration` | `object` | <!--source:api-specifications-->Export configuration object<!--/source--> |
| `ruleset_name` | `string` | <!--source:api-specifications-->Ruleset name for applying rules<!--/source--> |
| `language_name` | `string` | <!--source:api-specifications-->Language name for applying rules<!--/source--> |
| `delivery_configuration` | `object` | <!--source:api-specifications-->Delivery configuration object<!--/source--> |
| `platform` | `string` | <!--source:api-specifications-->The platform where the loan documents exist<!--/source-->`google_cloud``google_drive``sftp``sftp_client` |
| `mime_type` | `string` | <!--source:api-specifications-->Mime type for to be delivered document<!--/source-->`application_json``application_ld_json``application_xml` |
| `result_file_path` | `string` | <!--source:api-specifications-->Location for delivery<!--/source--> |
| `folder_name` | `string` | <!--source:api-specifications-->Folder name for Google Drive<!--/source--> |
| `bucket_name` | `string` | <!--source:api-specifications-->Bucket name for Google Cloud<!--/source--> |
| `user_name` | `string` | <!--source:api-specifications-->Username for Staircase SFTP server login<!--/source--> |
| `sftp_user_name` | `string` | <!--source:api-specifications-->Username for Staircase SFTP client login<!--/source--> |
| `sftp_password` | `string` | <!--source:api-specifications-->Password for Staircase SFTP client login<!--/source--> |
| `sftp_url` | `string` | <!--source:api-specifications-->URL for Staircase SFTP client login<!--/source--> |
| `batch_information` | `object` | <!--source:api-specifications-->Batch information object<!--/source--> |
| `loan_count` | `integer` | <!--source:api-specifications-->Loan count in the batch<!--/source--> |
| `register_date` | `string` | <!--source:api-specifications-->The date that loans are registered<!--/source--> |
| `start_date` | `string` | <!--source:api-specifications-->The date that boarding operation started<!--/source--> |
| `completion_date` | `string` | <!--source:api-specifications-->The date that boarding operation completed<!--/source--> |
| `daily_quota` | `integer` | <!--source:api-specifications-->Daily quota for completed loans<!--/source--> |
| `daily_labeler_count` | `integer` | <!--source:api-specifications-->Labeler counts that works on the process<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Successfully updated batch id
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `code` | `number` | <!--source:api-specifications-->Status code<!--/source--> |
| `message` | `object` | <!--source:api-specifications-->Message<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Request data failed validation
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unprocessed entity error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `422``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unprocessed Entity
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unprocessed entity error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

`POST` `/batches/{batch_id}/register`

<!--source:api-specifications-->

#### Register Transactions to Batch
<!--/source-->

`registerTransactionsToBatch`

<!--source:api-specifications-->
With this API, given transactions can be registered to the given batch. After this operation, you can use batch id for tracking status of the loans that has registered via status API: Status

<!--/source-->

##### Request

<!--source:api-specifications-->
application/json Copy
```
{
 "transaction_ids": [
 "01FYXZWD3JE1ZX9J0MR35RC8XM"
 ]
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
400422
<!--/source-->

<!--source:api-specifications-->
application/json Copy Request data failed validation

```
{
 "code": 400,
 "message": "Bad Request"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Unprocessed Entity

```
{
 "code": 422,
 "message": "Unprocessed Entity."
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
2
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `batch_id` required | `string` path | `01G42T1CQ7TKF14MPW6NA840FM` | <!--source:api-specifications-->Batch Id<!--/source--> |
| `x-api-key` required | `string` header | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` | <!--source:api-specifications-->Environment API Key.<!--/source--> |

##### Request body`application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `transaction_ids` | `string[]` | <!--source:api-specifications-->Transaction IDs for the loans that you imported and want to register<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Successfully retrieved batch
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Onboard result message<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Request data failed validation
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unprocessed entity error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `422``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unprocessed Entity
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unprocessed entity error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

`POST` `/batches/{batch_id}/execute`

<!--source:api-specifications-->

#### Execute Registered Transactions in Batch
<!--/source-->

`executeRegisteredTransactionsInBatch`

<!--source:api-specifications-->
With this API, user can execute the all registered transactions to the end of boarding process. Executed transactions are going to onboard, export and delivered with batch configuration. To complete all steps, batch configuration must contain onboard configuration and delivery configuration. Otherwise, batch execution cannot be started. Export configuration is optional; but if user wants to apply rules or translate result to customer language, export configuration is also required in the batch configuration.

The status of the batch can be tracked with status API with batch id: Status

<!--/source-->

##### Response

<!--source:api-specifications-->
400422
<!--/source-->

<!--source:api-specifications-->
application/json Copy Request data failed validation

```
{
 "code": 400,
 "message": "Bad Request"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Unprocessed Entity

```
{
 "code": 422,
 "message": "Unprocessed Entity."
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
2
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `batch_id` required | `string` path | `01G42T1CQ7TKF14MPW6NA840FM` | <!--source:api-specifications-->Batch Id<!--/source--> |
| `x-api-key` required | `string` header | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` | <!--source:api-specifications-->Environment API Key.<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Successfully retrieved batch
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Batch Execution result message<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Request data failed validation
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unprocessed entity error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `422``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unprocessed Entity
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unprocessed entity error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

## Providers

- Valon

## Errors

`400``422`

## More in Automation

- Previous product: Approval
- Next product: Income
