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

[@salesforce/b2c-tooling-sdk](../../modules.md) / [clients](../index.md) / createScapiSchemasClient

# Function: createScapiSchemasClient()

> **createScapiSchemasClient**(`config`, `auth`): [`ScapiSchemasClient`](../type-aliases/ScapiSchemasClient.md)

Defined in: [packages/b2c-tooling-sdk/src/clients/scapi-schemas.ts:178](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/e7c16f1ae423da0aa47b3e10be88f9770b53619b/packages/b2c-tooling-sdk/src/clients/scapi-schemas.ts#L178)

Creates a typed SCAPI Schemas API client.

Returns the openapi-fetch client directly, with authentication
handled via middleware. This gives full access to all openapi-fetch
features with type-safe paths, parameters, and responses.

The client automatically handles OAuth scope requirements:
- Domain scope: `sfcc.scapi-schemas` (or custom via config.scopes)
- Tenant scope: `SALESFORCE_COMMERCE_API:{tenantId}`

## Parameters

### config

[`ScapiSchemasClientConfig`](../interfaces/ScapiSchemasClientConfig.md)

SCAPI Schemas client configuration including shortCode and tenantId

### auth

[`AuthStrategy`](../../auth/interfaces/AuthStrategy.md)

Authentication strategy (typically OAuth)

## Returns

[`ScapiSchemasClient`](../type-aliases/ScapiSchemasClient.md)

Typed openapi-fetch client

## Example

```ts
// Create SCAPI Schemas client - scopes are handled automatically
const oauthStrategy = new OAuthStrategy({
  clientId: 'your-client-id',
  clientSecret: 'your-client-secret',
});

const client = createScapiSchemasClient(
  { shortCode: 'kv7kzm78', tenantId: 'zzxy_prd' },
  oauthStrategy
);

// List available SCAPI schemas
const { data, error } = await client.GET('/organizations/{organizationId}/schemas', {
  params: {
    path: { organizationId: toOrganizationId('zzxy_prd') }
  }
});

// Get a specific schema
const { data: schema } = await client.GET(
  '/organizations/{organizationId}/schemas/{apiFamily}/{apiName}/{apiVersion}',
  {
    params: {
      path: {
        organizationId: toOrganizationId('zzxy_prd'),
        apiFamily: 'shopper',
        apiName: 'products',
        apiVersion: 'v1'
      },
      query: { expand: 'custom_properties' }
    }
  }
);
```
