# deleteAddresses - Cart Module Reference

This documentation provides a reference to the `deleteAddresses` method. This belongs to the Cart Module.

You should only use this methods when implementing complex customizations. For common cases, check out [available workflows instead](https://docs.medusajs.com/medusa-workflows-reference).

## deleteAddresses(ids, sharedContext?): Promise\<void>

This method deletes addresses by their IDs.

### Example

```ts
await cartModuleService.deleteAddresses([
  "caaddr_123",
  "caaddr_321",
])
```

### Parameters

- ids: (\`string\`\[]) The IDs of the cart.
- sharedContext: (\[Context]\(../../../interfaces/cart.Context/page.mdx)) A context used to share resources, such as transaction manager, between the application and the module.

  - transactionManager: (TManager) An instance of a transaction manager of type \`TManager\`, which is a typed parameter passed to the context to specify the type of the \`transactionManager\`.

  - manager: (TManager) An instance of a manager, typically an entity manager, of type \`TManager\`, which is a typed parameter passed to the context to specify the type of the \`manager\`.

  - isolationLevel: (\`string\`) A string indicating the isolation level of the context. Possible values are \`READ UNCOMMITTED\`, \`READ COMMITTED\`, \`REPEATABLE READ\`, or \`SERIALIZABLE\`.

  - enableNestedTransactions: (\`boolean\`) A boolean value indicating whether nested transactions are enabled.

  - eventGroupId: (\`string\`) A string indicating the ID of the group to aggregate the events to be emitted at a later point.

  - transactionId: (\`string\`) A string indicating the ID of the current transaction.

  - messageAggregator: (\[IMessageAggregator]\(../../../interfaces/cart.IMessageAggregator/page.mdx)) An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.

  - requestId: (\`string\`) A string indicating the ID of the current request.

  - idempotencyKey: (\`string\`) A string indicating the idempotencyKey of the current workflow execution.

  - parentStepIdempotencyKey: (\`string\`) A string indicating the idempotencyKey of the parent workflow execution.

  - preventReleaseEvents: (\`boolean\`) preventReleaseEvents

  - isCancelling: (\`boolean\`) A boolean value indicating whether the current workflow execution is being cancelled.

### Returns

- Promise: (Promise\&#60;void\&#62;) Resolves when the addresses are deleted successfully.

## deleteAddresses(ids, sharedContext?): Promise\<void>

This method deletes an address by its ID.

### Example

```ts
await cartModuleService.deleteAddresses("caaddr_123")
```

### Parameters

- ids: (\`string\`) The IDs of the cart.
- sharedContext: (\[Context]\(../../../interfaces/cart.Context/page.mdx)) A context used to share resources, such as transaction manager, between the application and the module.

  - transactionManager: (TManager) An instance of a transaction manager of type \`TManager\`, which is a typed parameter passed to the context to specify the type of the \`transactionManager\`.

  - manager: (TManager) An instance of a manager, typically an entity manager, of type \`TManager\`, which is a typed parameter passed to the context to specify the type of the \`manager\`.

  - isolationLevel: (\`string\`) A string indicating the isolation level of the context. Possible values are \`READ UNCOMMITTED\`, \`READ COMMITTED\`, \`REPEATABLE READ\`, or \`SERIALIZABLE\`.

  - enableNestedTransactions: (\`boolean\`) A boolean value indicating whether nested transactions are enabled.

  - eventGroupId: (\`string\`) A string indicating the ID of the group to aggregate the events to be emitted at a later point.

  - transactionId: (\`string\`) A string indicating the ID of the current transaction.

  - messageAggregator: (\[IMessageAggregator]\(../../../interfaces/cart.IMessageAggregator/page.mdx)) An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.

  - requestId: (\`string\`) A string indicating the ID of the current request.

  - idempotencyKey: (\`string\`) A string indicating the idempotencyKey of the current workflow execution.

  - parentStepIdempotencyKey: (\`string\`) A string indicating the idempotencyKey of the parent workflow execution.

  - preventReleaseEvents: (\`boolean\`) preventReleaseEvents

  - isCancelling: (\`boolean\`) A boolean value indicating whether the current workflow execution is being cancelled.

### Returns

- Promise: (Promise\&#60;void\&#62;) Resolves when the address are deleted successfully.
