> For the complete documentation index, see [llms.txt](https://docs.liquidcommerce.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.liquidcommerce.cloud/services/users-api/delete-payment.md).

# Delete Payment

Delete a payment for a user by ID

## Endpoint Details <a href="#search-catalog" id="search-catalog"></a>

<mark style="color:red;">`DELETE`</mark> `/users/payments/purge/{userId}/{paymentId}`

### Path Parameters

<table><thead><tr><th>Name</th><th width="175" align="center">Type</th><th width="247">Description</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td><code>userId</code></td><td align="center">string</td><td>Existing user identifier, returned upon session creation or update</td><td>true</td></tr><tr><td><code>paymentId</code></td><td align="center">string</td><td>Existing payment identifier of the user</td><td>true</td></tr></tbody></table>

### Headers

| Header        | Value                        |
| ------------- | ---------------------------- |
| Content-Type  | `application/json`           |
| Authorization | `Bearer <YOUR_ACCESS_TOKEN>` |

### Response Details

<table><thead><tr><th width="226">Field</th><th width="168">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>statusCode</code></td><td>number</td><td>HTTP status code of the response</td></tr><tr><td><code>message</code></td><td>string</td><td>A brief message describing the result of the API call</td></tr><tr><td><code>metadata</code></td><td><a href="#metadata-object">metaDataObject</a></td><td>Contains metadata about the API call</td></tr><tr><td><code>data.deleted</code></td><td>boolean</td><td>States if delete succeded or not</td></tr><tr><td><code>data.message</code></td><td>string</td><td>Delete message</td></tr></tbody></table>

#### Metadata Object

<table><thead><tr><th width="144">Field</th><th width="140">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>languages</code></td><td>Array&#x3C;string></td><td>List of supported languages for the response, e.g. ["en"]</td></tr><tr><td><code>timestamp</code></td><td>string</td><td>Unix timestamp (in milliseconds) when the response was generated</td></tr><tr><td><code>timezone</code></td><td>string</td><td>Timezone used for the response, always "UTC"</td></tr><tr><td><code>requestId</code></td><td>string</td><td>Unique identifier for the API request. Used for debugging and support</td></tr><tr><td><code>path</code></td><td>string</td><td>API path</td></tr><tr><td><code>version</code></td><td>string</td><td>API version used for the request</td></tr></tbody></table>

### Sample Request and Response

```bash
curl --location 'https://staging.api.liquidcommerce.cloud/users/payments/purge' \
--header 'Authorization: Bearer <YOUR_ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
    "customerId": "usrid_123abc456def",
    "paymentMethodId": "paymentid_123abc456def",
    "isDefault": true
}'
```

{% tabs %}
{% tab title="200" %}

```json
{
    "statusCode": 200,
    "message": "Deleting a payment method",
    "metadata": {
        "languages": [
            "en"
        ],
        "timestamp": 1731600946784,
        "timezone": "UTC",
        "requestId": "reqid_123abc45def",
        "path": "/api/users/payments/purge/usr_123abc456def/paymentid_123abc456def",
        "version": "1.7.0"
    },
    "data": {
        "deleted": false,
        "message": "There's no Payment method with the ID provided for this customer"
    }
}
```

{% endtab %}
{% endtabs %}
