> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# DeleteDraftSubscriptionContract

# Package: subscriptions

# Namespace: DraftSubscriptionContractsService

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/payments/subscriptions/draft-subscription-contracts/delete-draft-subscription-contract.md

## Permission Scopes:
Delete draft subscription contracts: SCOPE.ECOM.DRAFT-SUBSCRIPTION-CONTRACT-DELETE

## Introduction

Deletes a draft subscription contract.

The subscription contract doesn't change. After you delete the draft subscription contract,
you can create another draft subscription contract for the same subscription contract.

You can delete only a draft subscription contract that you created.
You can't delete a draft subscription contract with the `COMMITTED` status.

---

## REST API

### Schema

```
 Method: deleteDraftSubscriptionContract
 Description: Deletes a draft subscription contract.  The subscription contract doesn't change. After you delete the draft subscription contract, you can create another draft subscription contract for the same subscription contract.  You can delete only a draft subscription contract that you created. You can't delete a draft subscription contract with the `COMMITTED` status.
 URL: https://www.wixapis.com/ecom/v1/draft-subscription-contracts/{draftSubscriptionContractId}
 Method: DELETE
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  draftSubscriptionContractId
 Method parameters: 
   param name: draftSubscriptionContractId | type:   none | required: true 
 Return type: DeleteDraftSubscriptionContractResponse
  EMPTY-OBJECT {}

 Possible Errors:
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: DRAFT_SUBSCRIPTION_CONTRACT_NOT_FOUND | Description: Couldn't find the draft subscription contract.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: DRAFT_BELONGS_TO_ANOTHER_OWNER | Description: Another identity created the draft subscription contract. You can access only a draft subscription contract that you created.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: COMMIT_IN_PROGRESS | Description: A commit of the draft subscription contract is in progress.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: ALREADY_COMMITTED | Description: Draft subscription contract was already committed, so you can't delete it.


```

### Examples

### Delete a draft subscription contract
Deletes a draft subscription contract. The subscription contract it was created from is not changed.

```curl
curl -X DELETE \
'https://www.wixapis.com/ecom/v1/draft-subscription-contracts/4858cbac-829c-4d0a-abdb-6358f082a118' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.ecom.draftSubscriptionContracts.deleteDraftSubscriptionContract(draftSubscriptionContractId)
 Description: Deletes a draft subscription contract.  The subscription contract doesn't change. After you delete the draft subscription contract, you can create another draft subscription contract for the same subscription contract.  You can delete only a draft subscription contract that you created. You can't delete a draft subscription contract with the `COMMITTED` status.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  draftSubscriptionContractId
 Method parameters: 
   param name: draftSubscriptionContractId | type: string | description: GUID of the draft subscription contract to delete. | required: true | validation: format GUID
 Return type: PROMISE<DeleteDraftSubscriptionContractResponse>
  EMPTY-OBJECT {}

 Possible Errors:
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: DRAFT_SUBSCRIPTION_CONTRACT_NOT_FOUND | Description: Couldn't find the draft subscription contract.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: DRAFT_BELONGS_TO_ANOTHER_OWNER | Description: Another identity created the draft subscription contract. You can access only a draft subscription contract that you created.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: COMMIT_IN_PROGRESS | Description: A commit of the draft subscription contract is in progress.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: ALREADY_COMMITTED | Description: Draft subscription contract was already committed, so you can't delete it.


```

### Examples

### Delete a draft subscription contract
Deletes a draft subscription contract. The subscription contract it was created from is not changed.

```javascript
import { draftSubscriptionContracts } from "@wix/ecom";

async function deleteDraftSubscriptionContract() {
  const response = await draftSubscriptionContracts.deleteDraftSubscriptionContract(
    "4858cbac-829c-4d0a-abdb-6358f082a118",
  );
}

```

### deleteDraftSubscriptionContract (self-hosted)
Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { draftSubscriptionContracts } from '@wix/ecom';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { draftSubscriptionContracts },
  // Include the auth strategy and host as relevant
});


async function deleteDraftSubscriptionContract(draftSubscriptionContractId) {
  const response = await myWixClient.draftSubscriptionContracts.deleteDraftSubscriptionContract(draftSubscriptionContractId);
};
```

---