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

# DELETE /v1/loyalty/memberships/{id}

> Delete a membership for good, with all its movements.

Deletes a membership permanently, along with its whole ledger. This cannot be undone. To stop a card temporarily and keep its balance, disable it from the portal instead.

The customer's wallet pass is voided. Apple and Google do not let a server remove a pass from a phone, so the card stays in the customer's Wallet marked as voided until they delete it.

## Endpoint

```
DELETE https://api.keebai.com/v1/loyalty/memberships/{id}
```

## Required scope

`loyalty:write`

## Headers

| Header | Required | Value |
| - | - | - |
| `Authorization` | Yes | `Bearer kbai_pk_<token>` |

## Path parameters

| Parameter | Type | Description |
| - | - | - |
| `id` | `string` | The membership `ObjectId`. |

## Example request

```bash curl theme={"system"}
curl -X DELETE https://api.keebai.com/v1/loyalty/memberships/6650aaaa1111bbbb2222cccc \
  -H "Authorization: Bearer kbai_pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
```

## Response

### 204 No Content

The membership and its movements were deleted.

### 401 Unauthorized

The token is missing, invalid, revoked, or expired.

### 403 Forbidden

The token does not have the `loyalty:write` scope.

### 404 Not Found

There is no membership with that id in your company.


## OpenAPI

````yaml DELETE /v1/loyalty/memberships/{id}
openapi: 3.0.0
info:
  title: Keebai Public API
  description: Superficie pública REST autenticada con Personal Access Tokens (PAT).
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.keebai.com
    description: Production
security: []
tags: []
paths:
  /v1/loyalty/memberships/{id}:
    delete:
      tags:
        - loyalty
      summary: Eliminar una membresía
      description: >-
        Borra la membresía y todos sus movimientos; no se puede deshacer. El
        pase en el Wallet del cliente queda anulado: ni Apple ni Google permiten
        quitarlo del teléfono.
      operationId: PublicLoyaltyController_deleteMembership
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '204':
          description: ''
      security:
        - PAT: []
components:
  securitySchemes:
    PAT:
      scheme: bearer
      bearerFormat: kbai_pk_<hex>
      type: http
      description: >-
        Personal Access Token con prefijo `kbai_pk_`. Generar desde el portal
        con permiso `developer.manage_tokens`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.