# Schema Reference

The application schema is used to configure the objects returned from a connector.

> [!NOTE]
>
> - The **Account Schema** tab is used to define the attributes for each object type in the application being configured. The schema attributes can be defined as **Entitlement** or **Multi-Valued**. Refer to [Managing Source Account Schemas](<https://documentation.sailpoint.com/saas/help/accounts/schema.html>) for more information.
> - The schema attributes that are not present by [default](<#default-account-schema>) must be defined as strings if not specified.

The Coupa connector uses the following default correlation and object configurations.

## Default Account Schema

Each source supports a variety of details, or attributes, about each user who has an account, such as their name, email address, manager name, and location.

The set of account attributes each source stores and how they're organized is known as the account's *schema*. To best represent your data, you can configure sources to use an account schema matching the one you use in the external connector. Refer to [Managing Source Account Schemas](<https://documentation.sailpoint.com/saas/help/accounts/schema.html>) for more information.

### Default Account ID

SailPoint requires that certain attributes remain in your configuration. These attributes are referred to as *account IDs*.

> [!CAUTION]
>
> Changing the attribute marked as the account ID after aggregating accounts can result in duplicate accounts being created. To avoid this, either reset the accounts on this source before editing the account ID attribute or edit the account ID attribute before aggregating accounts.
>
> To resolve issues caused by changing account IDs, reconfigure them to their default values.

The following table lists the default account IDs for this connector:

| Account ID | Schema Object Type |
| --- | --- |
| id | Account |
| Id | Role |

### Default Account Attributes

The Coupa connector supports the following default account schema attributes and customer configurable attributes. The attributes must be defined as strings if not specified.

| Attribute Name | Description |
| --- | --- |
| id | Coupa unique user identifier. This is an Account ID which must not be changed. |
| login | The user's login name |
| firstname | The user's first name |
| lastname | The user's last name |
| middlename | The user's middle name |
| fullname | The user's full name |
| email | The user's email address |
| active | The user's active status |
| default-currency | The user's default currency code |
| employee-payment-channel | Expense payment channel for user. For example, `ERP` or `CoupaPay` |
| authentication-method | Authentication method for user. For example, `coupa_credentials` or `saml` |
| employee-number | The user's employee number |
| manager | The user's manager's name |
| purchasing-user | Specifies whether or not the user has a Purchasing license. |
| expense-user | Specifies whether or not the user has an Expense license. |
| sourcing-user | Specifies whether or not the user has a Sourcing license. |
| inventory-user | Specifies whether or not the user has an Inventory license. |
| invoicing-user | Specifies whether or not the user has an Invoicing license. This attribute is not included in the default account schema. You must manually add it to the schema if required. The connector always aggregates Invoicing-licensed users. The `invoicing-user` attribute only indicates whether the users have the Invoicing license. |
| contracts-user | Specifies whether or not the user has a Contracts license. |
| sso-identifier | The user's single sign-on ID (SSO ID) |
| roles | List of roles attached to the user |
| user-groups | List of user groups attached to the user |
| content-groups | List of content groups attached to the user |
| approval-groups | List of approval groups attached to the user |
| account-groups | List of account groups attached to the user |
| licenses | List of licenses attached to the user |

> [!NOTE]
>
> The following licenses are handled as entitlements under the **licenses** attribute: purchasing-user, expense-user, sourcing-user, inventory-user, invoicing-user, contracts-user, analytics-user, aic-user, ccw-user, risk-assess-user, supply-chain-user, treasury-user, travel-user, spend-guard-user, clm-advanced-user, category-planner-user, category-strategy-user, msp-user.
>
> If you have any custom license in use, configure it with the multi-valued list `customLicenseAttributes` attribute through a `PATCH API` in the application attribute. For example:
>
> ```json
> [
>   {
>     "op": "add",
>     "path": "/connectorAttributes/customLicenseAttributes",
>     "value": ["<custom license attribute 1>", "<custom license attribute 2>"]
>   }
> ]
> ```

### Account Schema Extension for Standard and Custom Attributes

Configure the connector to include custom attributes from the source in account aggregation processes. To include additional custom attributes in the account aggregation processes, add the attribute name to the account schema exactly as it is configured in the source schema.

If you want to extend the default account schema and provisioning policy to manage other standard or custom attributes, you can use either of the following methods. When you add attributes to a default schema, whether they are standard or custom, you are extending the schema.

During account aggregation, the connector uses the default filter, `return_object=shallow`. If the aggregated data for custom attributes is incomplete using the default filter, then you need to add the `return_object=full` filter to the **Account Filter** field on the [Aggregation Settings](<https://documentation.sailpoint.com/connectors/coupa/va/help/connecting.html#aggregation-settings>) page.

For example, if the existing account filter is `type[blank]=true` and you need to fetch more data through the API as a result of extending the schema, then you can update the filter to `type[blank]=true&return_object=full`.

On the downside, adding the `return_object=full` filter degrades aggregation performance, since fetching full objects results in an increase in API response time and size. SailPoint recommends that you add schema attributes that require the full account filter only if they are critical for deployment.

#### Method 1

Add attributes returned by the `/users` API. The following are examples for standard, complex, and custom attributes:

- **Standard Attributes** - To add a mobile phone number for a user, define the `phone-mobile` attribute in the account schema and the provisioning policy.
- **Complex Attributes** - You can use "dot walking" to navigate to the field you want to include in the account schema or the provisioning policy. The following are examples for using dot walking:

  - To add the name of a country of residence, define `country-of-residence.name` as the field name in the schema and provisioning policy.
  - To show the country code for country of residence, define `country-of-residence.code` as the field name in the schema and provisioning policy.
- **Custom Attributes** - If it is a complex attribute, use dot walking to navigate to the field you are interested in using. Use the following format:

  ```text
  custom-fields.<field_name>
  ```

  For example, if `designation` is a custom attribute in your Coupa tenant, then add the `custom-fields.designation` attribute to the account schema and account provisioning policy.

> [!NOTE]
>
> For more information on the Coupa `/users` API, refer to [Users API](<https://success.coupa.com/Integrate/Technical_Documentation/API/Resources/Reference/users>).

#### Method 2

Add a JSONPath (JPath) based mapping to the connector in the `customUserObjectMapping` field.

For example, if you want to add definitions for the `roles` (standard attribute) and `designation` (custom attribute) attributes, you can map them to your connector using the following:

```xml
<entry key="customUserObjectMapping">
    <value>
        <Map>
            <entry key="roles" value="roles[*].name"/>
            <entry key="designation" value="custom-fields.designation"/>
        </Map>
    </value>
</entry>
```

Then you can update the account schema and account provisioning policy with just the name of the attribute. For example, `roles` or `designation` as a string type entry.

> [!NOTE]
>
> For more information on SailPoint's REST APIs, refer to [Best Practices: REST API Authentication](<https://developer.sailpoint.com/docs/api/authentication/>) and [REST API - Update Source (Partial)](<https://developer.sailpoint.com/docs/api/update-source-v-1/>) in the SailPoint Developer Community.

### Default Role Attributes

The Coupa connector supports roles. The following attributes must be configured on the managed system and in the SailPoint source schema to manage roles.

| Attribute Name | Description |
| --- | --- |
| id | Coupa unique user identifier. This is an Account ID which must not be changed. |
| name | The name of the role |
| description | The description of the role |
| omnipotent | Specifies whether it is an administrative role or not |
| created-at | Denotes the time stamp for when the role is created |
| updated-at | Denotes the time stamp for when the role is updated |
| system-role | Indicates if the role is a system role |
