# Extending the SAP Ariba extraction tool

> The [SAP Ariba Purchase-to-Pay](https://apptemplatesdocs.blob.core.windows.net/documentation/uipathP2PSAPAriba/SAP-Ariba-Purchase-to-Pay.html) and the [SAP Ariba Vendor-Sourcing](https://apptemplatesdocs.blob.core.windows.net/documentation/uipathVSSAPAriba/SAP-Ariba-Vendor-Sourcing.html) app templates contain an extractor that allows to extract data from SAP Ariba in CSV format using Ariba APIs for the app template specific processes. This page describes how to extend this extractor with a new API configuration if you want to extract data from SAP Ariba for other processes, for example, Supplier management, or Invoice management.

## Introduction

The [SAP Ariba Purchase-to-Pay](https://apptemplatesdocs.blob.core.windows.net/documentation/uipathP2PSAPAriba/SAP-Ariba-Purchase-to-Pay.html) and the [SAP Ariba Vendor-Sourcing](https://apptemplatesdocs.blob.core.windows.net/documentation/uipathVSSAPAriba/SAP-Ariba-Vendor-Sourcing.html) app templates contain an extractor that allows to extract data from SAP Ariba in CSV format using Ariba APIs for the app template specific processes. This page describes how to extend this extractor with a new API configuration if you want to extract data from SAP Ariba for other processes, for example, Supplier management, or Invoice management.

## Prerequisites

It is assumed that you have:

* basic knowledge on Python.
* knowledge about the SAP Ariba API.
* downloaded and extracted the `SAP_Ariba_extractor.zip` extraction tool from the [SAP Ariba Purchase-to-Pay](https://apptemplatesdocs.blob.core.windows.net/documentation/uipathP2PSAPAriba/SAP-Ariba-Purchase-to-Pay.html) or [SAP Ariba Vendor-Sourcing](https://apptemplatesdocs.blob.core.windows.net/documentation/uipathVSSAPAriba/SAP-Ariba-Vendor-Sourcing.html) app template documentation.

## Adding a new API configuration

Follow these steps to add a new API configuration to the SAP Ariba extraction tool.

1. Add the API configuration in the file `extractor/developer_settings.yaml` file of the extraction tool.
2. Add the corresponding `***_api_key`, `***_client_id`, and `***_secret` to the `user_settings.yaml` file.
3. If a new model is needed, add it to the `models/` folder of the extraction tool. If needed, add a new table in the `tables/` folder.
   :::note
   The table must have fields that are included in the model.
   :::
4. In the `extractor/settings.py` file,
   1. add the newly created model to the existing `_MODELS_MAPPING_` variable.
   2. add the newly created table to the existing `_TABLE_MAPPING_` variable.
5. In case you want to call multiple models with a single call, add a constant in `/utils/constants.py` and extend `cli_handler/entrypoint.py` to use the constant to extract all models.
