Use this method to remove a stored payment method — for example, when a customer asks to forget a card, or after a one-off purchase where you don’t want to retain card details. For request and response details, see the Delete payment method API. To obtain aDocumentation Index
Fetch the complete documentation index at: https://dev.moonpay.com/llms.txt
Use this file to discover all available pages before exploring further.
paymentMethodId, list the customer’s stored payment methods with client.getPaymentMethods().
Delete a payment method
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
paymentMethodId | string | ✅ | The id of the stored card to delete. Obtain this from client.getPaymentMethods(). |
Result
client.deletePaymentMethod() returns a Result<void, DevPlatformApiError>.
The API responds with 204 No Content on success, so result.value is undefined — there is no response body to read. Check result.ok to confirm the delete succeeded.
Result envelope
Result<void, DevPlatformApiError>
| Field | Type | Required | Description |
|---|---|---|---|
ok | boolean | ✅ | Whether the operation succeeded. |
value | undefined | Present when ok is true. Always undefined (no response body). | |
error | DevPlatformApiError | Present when ok is false. |
DevPlatformApiError
The standard MoonPay Platform API error shape.
| Field | Type | Required | Description |
|---|---|---|---|
code | DevPlatformApiErrorCode | ✅ | A machine-readable error code (for example, "not_found", "unauthorized"). See the error reference for the full list. |
message | string | ✅ | A developer-friendly message. |
errors | DevPlatformApiErrorDetail[] | Optional list of field-level errors. |
TS Definition
TS Definition
types.ts