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

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

# Type Alias: ScapiCallInterceptor()

> **ScapiCallInterceptor** = (`call`, `next`) => `Promise`\<`unknown`\>

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

Wraps the handling of every live call (calls answered from a journal are not handled again).
Call `next()` to let the call proceed, return a value to answer it without proceeding, or throw
to fail it; the program sees the thrown message. Throw [ScapiCodePause](../classes/ScapiCodePause.md) to end the
execution so it can resume later with the journal. Interceptors run in array order, outermost first.

## Parameters

### call

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

### next

() => `Promise`\<`unknown`\>

## Returns

`Promise`\<`unknown`\>
