Delete card
DEL /v2/api-gateway/cards/{card_id}
Terminates the card, refunding any remaining balance to your prepaid balance first where the card product holds a balance. Fails while the card has a negative balance or pending transactions. Returns 200 (not 204) with { message: "Card deleted" }.
Request
Authentication: your API key in the x-api-key header.
Path parameters
| Field | Type | Description |
|---|---|---|
card_ required | string, uuid | Card UUID (the card id returned by the card endpoints). |
Example request
cURL
curl --request DELETE \
--url 'https://api.themooncard.com/v2/api-gateway/cards/7c9e6679-7425-40de-944b-e07fc1f90ae7' \
--header 'x-api-key: YOUR_API_KEY'Responses
200 Success
| Field | Type | Description |
|---|---|---|
message required | string | Human-readable confirmation of what happened. The wording is fixed per route — the response description on each operation quotes it — but it is not a stable machine key: branch on the 2xx status, not on this text. |
JSON
{
"message": "Card deleted"
}400 Error
The body is the standard error object: see Errors.
401 Error
Missing or invalid credentials, e.g. { "message": "Invalid API Key", "code": "UNAUTHORIZED" }.
The body is the standard error object: see Errors.
404 Error
Card not found or not owned by you (CARD_), or the card or your organization has no balance to refund (CARD_, MOON_).
The body is the standard error object: see Errors.
500 Error
Unexpected server error. Body is { message: "Internal server error", code: "INTERNAL_.
The body is the standard error object: see Errors.
Last updated June 5, 2026