Delete card
DEL /v1/api-gateway/card/{card_id}
Refunds the card's remaining available balance to your organization's prepaid balance, then terminates the card. Returns 200 with a message (not 204).
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/v1/api-gateway/card/7c9e6679-7425-40de-944b-e07fc1f90ae7' \
--header 'x-api-key: YOUR_API_KEY'Responses
200 Success
{ "message": "Card deleted" }.
| 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 this organization (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 August 16, 2026