---
agentTools:
  projectIndex: https://developers.commerce.busha.co/llms.txt
---

# Cancel Charge

Cancel a charge

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Commerce",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.commerce.busha.co"
    }
  ],
  "security": [
    {}
  ],
  "paths": {
    "/charges/{id}/cancel": {
      "put": {
        "summary": "Cancel Charge",
        "description": "Cancel a charge",
        "operationId": "cancel-charge",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "uuid unique identifier for a charge",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "X-BC-API-KEY",
            "in": "header",
            "description": "Your business secret key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"status\": \"success\",\n    \"message\": \"Charge successfully cancelled\",\n    \"data\": {\n        \"id\": \"013a7d5b-942d-4aff-b767-ada68695494b\",\n        \"business_id\": \"169c9ff2-4af1-4115-a7eb-363827022624\",\n        \"reference\": \"CHRG_MQTLUSZCA0\",\n        \"hosted_url\": \"https://busha-pug-landing-staging.vercel.app\",\n        \"price_fixed\": false,\n        \"meta\": {\n            \"name\": \"Sarah Shaw\",\n            \"email\": \"sarah.shaw@example.co\"\n        },\n        \"expires_at\": \"2023-02-24T14:51:10.823258+01:00\",\n        \"timeline\": [\n            {\n                \"status\": \"NEW\",\n                \"created_at\": \"2023-02-24T13:51:10.82685+01:00\"\n            },\n            {\n                \"status\": \"CANCELLED\",\n                \"created_at\": \"2023-02-24T13:51:39.14504+01:00\"\n            }\n        ],\n        \"address\": [],\n        \"payment\": [],\n        \"pricing\": [\n            {\n                \"currency_id\": \"NGN\",\n                \"amount\": \"50000\",\n                \"rate\": 1\n            }\n        ],\n        \"local_amount\": \"50000\",\n    }\n}"
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"error\": {\n        \"name\": \"bad_request\",\n        \"message\": \"only newly created charges can be cancelled\"\n    }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "example": "bad_request"
                        },
                        "message": {
                          "type": "string",
                          "example": "only newly created charges can be cancelled"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"error\": {\n    \"name\": \"unauthorized\",\n    \"message\": \"Invalid Authentication\"\n  }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "example": "unauthorized"
                        },
                        "message": {
                          "type": "string",
                          "example": "Invalid Authentication"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "63f94c2f2017a0005783edff:63fa7c94108d22005ffbb700"
}
```