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