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

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

# Function: createScapiRequestError()

> **createScapiRequestError**(`error`, `response`, `fallbackMessage`): [`ScapiRequestError`](../classes/ScapiRequestError.md)

Defined in: [packages/b2c-tooling-sdk/src/clients/scapi-backend-utils.ts:153](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/2feab01f654eec77c6d702777ec2818472f131f1/packages/b2c-tooling-sdk/src/clients/scapi-backend-utils.ts#L153)

Creates a structured SCAPI error using the repository's common formatter.

## Parameters

### error

`unknown`

### response

`Response` | \{ `status`: `number`; `statusText`: `string`; \}

### fallbackMessage

`string`

## Returns

[`ScapiRequestError`](../classes/ScapiRequestError.md)
