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

[@salesforce/b2c-tooling-sdk](../../../modules.md) / [operations/mrt](../index.md) / waitForDeploymentScapi

# Function: waitForDeploymentScapi()

> **waitForDeploymentScapi**(`conn`, `options`): `Promise`\<\{ \}\>

Defined in: [packages/b2c-tooling-sdk/src/operations/mrt/deployment.ts:530](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/1dedfc1ffefa01c3d5bff62c8f7e7e682a1a91cd/packages/b2c-tooling-sdk/src/operations/mrt/deployment.ts#L530)

Polls a SCAPI deployment by ID until it reaches a terminal status
(`finished` or `failed`) or the timeout elapses.

Uses `getDeploymentById`, which shares the `sfcc.storefront.deployments` read
scope with the list — a direct by-ID poll costs no extra scope over
list-polling and avoids page-scanning ambiguity.

## Parameters

### conn

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

### options

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

## Returns

`Promise`\<\{ \}\>

## Throws

Error if the timeout is reached or the deployment fails.
