---
updatedAt: 2025-11-13T14:13:09.000Z
agentTools:
  siteIndex: https://docs.affirm.com/llms.txt
  projectIndex: https://docs.affirm.com/developers/llms.txt
---

# Cancel Card

Cancels an authorized loan and voids the corresponding virtual card.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Cards API",
    "version": "2.0"
  },
  "security": [
    {
      "basicAuth": []
    }
  ],
  "paths": {
    "/cards/{checkout_id}/cancel": {
      "post": {
        "tags": [
          "Cards API"
        ],
        "operationId": "cancel_card",
        "summary": "Cancel Card",
        "description": "Cancels an authorized loan and voids the corresponding virtual card.",
        "parameters": [
          {
            "in": "path",
            "name": "checkout_id",
            "description": "a unique idenifier of the VCN transaction",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200 OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/CardResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400 Bad Request",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401 Unauthorized",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorUnauthorized"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404 Not Found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorNotFound"
                }
              }
            }
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://api.global.affirm.com/api/v2"
    },
    {
      "url": "https://api.global-sandbox.affirm.com/api/v2"
    }
  ],
  "components": {
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    },
    "schemas": {
      "ErrorBadRequest": {
        "properties": {
          "message": {
            "description": "The error message.",
            "example": "Bad Request",
            "type": "string"
          },
          "status_code": {
            "description": "The HTTP status code.",
            "example": 400,
            "type": "integer"
          },
          "type": {
            "description": "The error type.",
            "example": "BAD_REQUEST",
            "type": "string"
          },
          "code": {
            "description": "The error type.",
            "example": "BAD_REQUEST",
            "type": "string"
          }
        }
      },
      "ErrorNotFound": {
        "properties": {
          "message": {
            "description": "The error message.",
            "example": "Not Found",
            "type": "string"
          },
          "status_code": {
            "description": "The HTTP status code.",
            "example": 404,
            "type": "integer"
          },
          "type": {
            "description": "The error type.",
            "example": "NOT_FOUND",
            "type": "string"
          },
          "code": {
            "description": "The error type.",
            "example": "NOT_FOUND",
            "type": "string"
          },
          "token": {
            "description": "The error response embedded in a JWT token",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ErrorUnauthorized": {
        "properties": {
          "message": {
            "description": "The error message.",
            "example": "Unauthorized",
            "type": "string"
          },
          "status_code": {
            "description": "The HTTP status code.",
            "example": 401,
            "type": "integer"
          },
          "type": {
            "description": "The error type.",
            "example": "UNAUTHORIZED",
            "type": "string"
          },
          "code": {
            "description": "The error type.",
            "example": "UNAUTHORIZED",
            "type": "string"
          },
          "token": {
            "description": "The error response embedded in a JWT token",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CardResponse": {
        "type": "object",
        "properties": {
          "message": {
            "description": "A message on the action taken on the virtual card.",
            "example": "The card was successfully scheduled to finalize. You should see changes reflected in 24 hours.",
            "type": "string"
          },
          "code": {
            "description": "A code sharing the status of this action. The code will be \"success\" for 200 responses, or explain the error for 400 responses.",
            "example": "success",
            "type": "string"
          },
          "checkout_token": {
            "description": "The `checkout_id` of the virtual card.",
            "example": "FA0UUFRGOND84S7C",
            "type": "string"
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```

# Sibling pages

* [Read Card](https://docs.affirm.com/developers/reference/read_card.md)
* [Finalize a card](https://docs.affirm.com/developers/reference/finalize_card.md)