Add balance to card
POST /v1/api-gateway/card/{card_id}/add-balance
Moves amount from your organization's prepaid balance onto a reloadable Moon Prepaid card (amount may be 0, which moves nothing).
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). |
Headers
| Field | Type | Description |
|---|---|---|
Idempotency-Key | string | A unique string you choose, up to 255 characters, that makes this request safe to retry. If a request times out or fails in transit, send it again with the same key: the status code and body of the first attempt are returned and the operation is not performed a second time. Stored replies — including failures — are replayed for 24 hours, after which the same key starts a fresh request. Reusing a key for a different request, or sending it while the first request is still running, returns 409. Omit the header and the request behaves exactly as before. Document upload endpoints do not accept it. |
Body
| Field | Type | Description |
|---|---|---|
amount required | number | Amount to move from your organization's prepaid balance onto the card, in major units (e.g. 25.50). Must be at least 0 and not exceed your available prepaid balance; 0 is accepted and moves nothing. |
Example request
cURL
curl --request POST \
--url 'https://api.themooncard.com/v1/api-gateway/card/7c9e6679-7425-40de-944b-e07fc1f90ae7/add-balance' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'content-type: application/json' \
--data '{
"amount": 25.5
}'Responses
200 Success
| Field | Type | Description |
|---|---|---|
id required | string | Card id. |
balance required | string, nullable | Current balance, "0.00" style string, or null. |
true_ required | string, nullable | Balance including pending holds, or null. |
expiration required | string, date-time, nullable | Expiration as an ISO-8601 timestamp, or null when unknown. |
display_ required | string | Expiration formatted for display, e.g. "12/29". |
available_ required | string, nullable | Spendable balance, or null. |
terminated required | integer | 1 when the card is terminated, otherwise 0.One of: 0, 1 |
card_ required | string | Card product this card was issued from. |
pan required | string | Full card number. |
cvv required | string, nullable | Card verification value, or null when not available. |
support_ required | string | Token to reference this card in support requests. |
frozen required | integer | 1 when the card is frozen, otherwise 0.One of: 0, 1 |
activated required | integer | 1 when the card is activated, otherwise 0.One of: 0, 1 |
metadata required | object | The key-value data you stored on this card, returned exactly as you sent it. An empty object when you never set any — it is never null. |
JSON
{
"id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"balance": "25.50",
"true_balance": "25.50",
"expiration": "2029-12-31T23:59:59Z",
"display_expiration": "12/29",
"available_balance": "25.50",
"terminated": 0,
"card_product_id": "a8358b18-be77-41b7-af4d-f4e9760cba86",
"pan": "4111111111111111",
"cvv": "123",
"support_token": "ST-8QK2-4M7D",
"frozen": 0,
"activated": 1,
"metadata": {
"order_id": "ORD-10294"
}
}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.
403 Error
The account owner requires every card created by a connected agent to ask before each purchase, and this card does not ask first (AGENT_). Use a card that asks first. Only the account owner can change that setting.
The body is the standard error object: see Errors.
404 Error
Card not found or not owned by this organization (CARD_), or your organization has no prepaid balance yet (USER_, MOON_).
The body is the standard error object: see Errors.
409 Error
The Idempotency-Key you sent is already in use. IDEMPOTENCY_ — the key was used for a different request; send a new key, or repeat the original request exactly to receive its stored response. IDEMPOTENCY_ — the first request with this key has not finished yet; retry in a few seconds.
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 April 30, 2026