---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../modules.md) / [scapi](../index.md) / resolveScapiDocuments

# Function: resolveScapiDocuments()

> **resolveScapiDocuments**(`options`): `Promise`\<[`ResolvedScapiDocuments`](../interfaces/ResolvedScapiDocuments.md)\>

Defined in: [packages/b2c-tooling-sdk/src/scapi/documents.ts:87](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/scapi/documents.ts#L87)

The contracts a SCAPI search or code-mode program should see: bundled contracts,
replaced by the tenant's live contracts when `live` is given, replaced by `local`
contracts. When live loading fails (missing access, network), returns the bundled
contracts with a warning, except for `custom` APIs, which exist only on the tenant.

## Parameters

### options

[`ResolveScapiDocumentsOptions`](../interfaces/ResolveScapiDocumentsOptions.md) = `{}`

## Returns

`Promise`\<[`ResolvedScapiDocuments`](../interfaces/ResolvedScapiDocuments.md)\>

## Example

```typescript
const cache = new ScapiLiveSchemaCache();
const {documents, warnings} = await resolveScapiDocuments({
  api: 'product',
  live: {tenant: {client: schemasClient, shortCode: 'abc123', organizationId: 'f_ecom_zzzz_001'}, cache},
});
const hits = searchScapiOperations(documents, 'update product');
```
