# Remove card from member's wallet

`DELETE /api/members/{memberId}/wallet/gladstonepay/{cardId}`

- **Products:** Operator (`FOH`), Consumer (`CONSUMER`) (any one of these products, not all)
- **Features:** Online Bookings (`ONLINEBOOK`), Online Joining (`ONLINEJOIN`), Front of House Generic Access (`FOHGENERIC`) (any one of these features, not all)

HTML version: [Remove card from member's wallet](https://support.gladstonesoftware.cloud/reference/members/remove-card-from-members-wallet)

## Overview

Removes a stored card from a member's wallet so it is no longer offered as a saved payment method. A successful call returns `204 No Content` with no body.

Before deleting anything, the endpoint checks the member's wallet at the payment provider for two things: that a card with this `cardId` really is in *that* member's wallet, and that the card is not the member's designated recurring payment card. Each failed check aborts the request rather than deleting — the first with `404`, the second with `400`. To remove a card that is currently designated for recurring payments, point the designation at a different card first with `PUT /api/members/{memberId}/rcp-card`, then delete.

Two limits are worth knowing before you build on this. The deletion happens at the payment provider, not in Gladstone: the member's link to their provider wallet is kept, and nothing else in Gladstone is updated — so a member who deletes their last card still has a wallet as far as Gladstone is concerned. And of the provider's possible answers to the delete, only `401` is surfaced to you; any other provider-side failure still comes back as `204`. If you need certainty that the card has gone, re-read the wallet afterwards and confirm the `cardID` is absent.

To find the right `cardId` in the first place, list the member's cards with `GET /api/members/{memberId}/wallet/gladstonepay`.

## Endpoint

`DELETE {base_url}/api/members/{memberId}/wallet/gladstonepay/{cardId}`

`{base_url}` is the environment URL issued to your integration. See [Authenticating with Gladstone APIs](../../guides/authenticating-with-gladstone-apis.md).

## Path parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `memberId` | integer (int32) | Yes | The member whose wallet the card sits in. Must be the member identified by your access token, or a member linked to them; any other member is rejected with `403`. The card must belong to this member's wallet — the wallet is checked first and the endpoint answers `404` if the card is not in it, so you cannot reach another member's card by guessing an id. |
| `cardId` | integer (int32) | Yes | The card to remove. Take the value from `data[].cardID` in the response of `GET /api/members/{memberId}/wallet/gladstonepay` — that is the value the card is matched on. If it is the member's designated recurring payment card (`rcpCardId` from `GET /api/members/{memberId}/rcp-card`), the request is refused with `400` and nothing is deleted. |

## Sample request

```bash title="cURL"
curl -X DELETE '{base_url}/api/members/{memberId}/wallet/gladstonepay/{cardId}' \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'X-Use-SSO: true'
```

## Errors

| Status | Meaning | When |
|--------|---------|------|
| `400` | Bad request | The card is the member's designated recurring payment card, which cannot be deleted. The body is `'{cardId}' is an RCP card and cannot be deleted.` Designate a different card with `PUT /api/members/{memberId}/rcp-card` first, then retry the delete. |
| `401` | Unauthorized | The payment provider's wallet API rejected the credentials configured for this tenant — either when the wallet was read, or when the delete was sent. The provider's own response body is passed straight through as the body of this error. Nothing about your request will change the outcome; the tenant's GladstonePay wallet credentials need correcting. |
| `404` | Not found | Either the member has no wallet — one exists only once their first card has been saved through `POST /api/members/{memberId}/wallet/card` — or no card with this `cardId` is in that member's wallet, in which case the body is `Card with id {cardId} does not exist for member with id {memberId}`. |
| `422` | Unprocessable entity | The tenant's GladstonePay wallet configuration is missing or incomplete — the wallet API URL, username or password. This is a Gladstone-side configuration fix, not something you can correct in the request. |
| `500` | Internal server error | Any other unexpected failure, including the payment provider being unreachable and the provider returning a payload that cannot be parsed. The response has no body, and the card may or may not have been removed — re-read the wallet to find out. |
