> ## Documentation Index
> Fetch the complete documentation index at: https://developers.pcibooking.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Card Entry Form

> Delete a card entry form session created via the API.

<Card title="Hosted Card Entry Form Guide" icon="book" href="/capture-cards/hosted-card-entry-form#option-2-api-session">
  API session approach for embedded card capture
</Card>

Use this endpoint to delete a card entry form session that is no longer needed. Once deleted, the form URL becomes invalid and the cardholder can no longer submit card details through it. Delete sessions that have expired or been completed to keep your active sessions clean.

## Error Responses

| Code  | HTTP Status | Condition                                                               |
| ----- | ----------- | ----------------------------------------------------------------------- |
| -1003 | 401         | Missing or invalid API key in the `Authorization` header.               |
| N/A   | 403         | The session belongs to a different user than the authenticated API key. |
| N/A   | 404         | Card entry form session with the specified `RequestID` was not found.   |

## Parameters

### Headers

<ParamField header="Authorization" type="string" required>
  Your API key prefixed with `APIKEY`. Example: `APIKEY your-api-key`. See the [Authentication guide](/getting-started/authentication).
</ParamField>

### Path Parameters

<ParamField path="RequestID" type="string" required>
  The request ID returned from [Create Card Entry Form session](/api-reference/tokenize-cards/create-card-entry-form-session).
</ParamField>

<RequestExample>
  ```javascript Node.js theme={null}
  const requestID = 'ITGdnzZuR7hQOI583EUB8U9vC3aPjuoV';

  const response = await fetch(
    `https://service.pcibooking.net/api/capturecard/${requestID}`,
    {
      method: 'DELETE',
      headers: {
        'Authorization': 'APIKEY your-api-key'
      }
    }
  );

  console.log('Deleted:', response.status === 200);
  ```

  ```python Python theme={null}
  import requests

  request_id = 'ITGdnzZuR7hQOI583EUB8U9vC3aPjuoV'

  response = requests.delete(
      f'https://service.pcibooking.net/api/capturecard/{request_id}',
      headers={
          'Authorization': 'APIKEY your-api-key'
      }
  )

  print('Deleted:', response.status_code == 200)
  ```
</RequestExample>

## Response

**200** - Session deleted successfully.

**404** - Session not found.

<ResponseExample>
  ```text 200 theme={null}
  Card entry form deleted successfully. No content returned.
  ```

  ```json 401 theme={null}
  {
      "code": -1003,
      "message": "Not authorized to access this resource",
      "moreInfo": "Bad or missing authorization data, expected APIKEY",
      "errorList": null
  }
  ```
</ResponseExample>
