---
title: "Remove a saved card"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.ezghcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Billing API › Billing

`DELETE /v1/organizations/{orgId}/payment-methods/{paymentMethodId}`

## Authentication

Requires one of the following:

- `apiKey`, http, header `Authorization`
- `oauth`, http, header `Authorization`
- `sessionCookie`, apiKey, in cookie

## Path parameters

- `DeletePaymentMethod.path.orgId` (string, required)
  - format `uuid`
- `DeletePaymentMethod.path.paymentMethodId` (string, required) — pm_…

## Code samples

### cURL

```curl
curl --request DELETE \
  --url https://billing.ezghcloud.com/v1/organizations/497f6eca-6276-4993-bfeb-53cbbbba6f08/payment-methods/string \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://billing.ezghcloud.com/v1/organizations/497f6eca-6276-4993-bfeb-53cbbbba6f08/payment-methods/string';
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://billing.ezghcloud.com/v1/organizations/497f6eca-6276-4993-bfeb-53cbbbba6f08/payment-methods/string"

headers = {"Authorization": "Bearer <token>"}

response = requests.delete(url, headers=headers)

print(response.text)
```

## Responses

### 204

Removed

### 401

unauthenticated: no valid credential.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "issues": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```

- `DeletePaymentMethod.response.401.error` (object, required)
  - `DeletePaymentMethod.response.401.error.code` (string, required) — What went wrong, for programs: branch on this, never on message.
  - `DeletePaymentMethod.response.401.error.message` (string, required) — What went wrong, for people.
  - `DeletePaymentMethod.response.401.error.issues` (array<object>, optional) — With invalid_request: each invalid field.
    - `DeletePaymentMethod.response.401.error.issues.path` (string, required)
    - `DeletePaymentMethod.response.401.error.issues.message` (string, required)

### 403

access_denied: the caller isn't allowed to (the message names the action); forbidden_origin: a cookie-authenticated write from another site.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "issues": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```

- `DeletePaymentMethod.response.403.error` (object, required)
  - `DeletePaymentMethod.response.403.error.code` (string, required) — What went wrong, for programs: branch on this, never on message.
  - `DeletePaymentMethod.response.403.error.message` (string, required) — What went wrong, for people.
  - `DeletePaymentMethod.response.403.error.issues` (array<object>, optional) — With invalid_request: each invalid field.
    - `DeletePaymentMethod.response.403.error.issues.path` (string, required)
    - `DeletePaymentMethod.response.403.error.issues.message` (string, required)

### 404

not_found: the organization (or one the caller doesn't belong to), or the resource, doesn't exist.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "issues": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```

- `DeletePaymentMethod.response.404.error` (object, required)
  - `DeletePaymentMethod.response.404.error.code` (string, required) — What went wrong, for programs: branch on this, never on message.
  - `DeletePaymentMethod.response.404.error.message` (string, required) — What went wrong, for people.
  - `DeletePaymentMethod.response.404.error.issues` (array<object>, optional) — With invalid_request: each invalid field.
    - `DeletePaymentMethod.response.404.error.issues.path` (string, required)
    - `DeletePaymentMethod.response.404.error.issues.message` (string, required)

### 429

too_many_requests: slow down.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "issues": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```

- `DeletePaymentMethod.response.429.error` (object, required)
  - `DeletePaymentMethod.response.429.error.code` (string, required) — What went wrong, for programs: branch on this, never on message.
  - `DeletePaymentMethod.response.429.error.message` (string, required) — What went wrong, for people.
  - `DeletePaymentMethod.response.429.error.issues` (array<object>, optional) — With invalid_request: each invalid field.
    - `DeletePaymentMethod.response.429.error.issues.path` (string, required)
    - `DeletePaymentMethod.response.429.error.issues.message` (string, required)

### 500

internal_error: a bug; the details are in the logs, under the request ID.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "issues": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```

- `DeletePaymentMethod.response.500.error` (object, required)
  - `DeletePaymentMethod.response.500.error.code` (string, required) — What went wrong, for programs: branch on this, never on message.
  - `DeletePaymentMethod.response.500.error.message` (string, required) — What went wrong, for people.
  - `DeletePaymentMethod.response.500.error.issues` (array<object>, optional) — With invalid_request: each invalid field.
    - `DeletePaymentMethod.response.500.error.issues.path` (string, required)
    - `DeletePaymentMethod.response.500.error.issues.message` (string, required)

### 502

payment_provider_error: the payment provider request failed.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "issues": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```

- `DeletePaymentMethod.response.502.error` (object, required)
  - `DeletePaymentMethod.response.502.error.code` (string, required) — What went wrong, for programs: branch on this, never on message.
  - `DeletePaymentMethod.response.502.error.message` (string, required) — What went wrong, for people.
  - `DeletePaymentMethod.response.502.error.issues` (array<object>, optional) — With invalid_request: each invalid field.
    - `DeletePaymentMethod.response.502.error.issues.path` (string, required)
    - `DeletePaymentMethod.response.502.error.issues.message` (string, required)

### 503

unavailable, ledger_unavailable or payments_unavailable: retry later.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "issues": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```

- `DeletePaymentMethod.response.503.error` (object, required)
  - `DeletePaymentMethod.response.503.error.code` (string, required) — What went wrong, for programs: branch on this, never on message.
  - `DeletePaymentMethod.response.503.error.message` (string, required) — What went wrong, for people.
  - `DeletePaymentMethod.response.503.error.issues` (array<object>, optional) — With invalid_request: each invalid field.
    - `DeletePaymentMethod.response.503.error.issues.path` (string, required)
    - `DeletePaymentMethod.response.503.error.issues.message` (string, required)


Source: https://docs.ezghcloud.com/billing-api/Billing/DeletePaymentMethod/index.md
