---
updatedAt: 2025-11-13T14:41:00.000Z
agentTools:
  siteIndex: https://docs.affirm.com/llms.txt
  projectIndex: https://docs.affirm.com/developers/v1.0-Global-Integration/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": "3.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"
            }
          },
          {
            "in": "header",
            "name": "country-code",
            "description": "Required param to identify the country in which Affirm is used and uses an \"alpha-3\" three-letter country code. Supported countries are the United States (`USA`), Canada (`CAN`), and the United Kingdom (`GBR`).",
            "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,
    "samples-enabled": true
  }
}
```

# Sibling pages

* [The card object](https://docs.affirm.com/developers/v1.0-Global-Integration/reference/the-card-object.md)
* [The billing object](https://docs.affirm.com/developers/v1.0-Global-Integration/reference/the-billing-object.md)
* [Name object](https://docs.affirm.com/developers/v1.0-Global-Integration/reference/name-object.md)
* [Address object](https://docs.affirm.com/developers/v1.0-Global-Integration/reference/address-object.md)
* [The response object](https://docs.affirm.com/developers/v1.0-Global-Integration/reference/the-response-object.md)
* [Read Card](https://docs.affirm.com/developers/v1.0-Global-Integration/reference/read_card.md)
* [Finalize a card](https://docs.affirm.com/developers/v1.0-Global-Integration/reference/finalize_card.md)