---
updatedAt: 2025-06-28T06:32:19.000Z
agentTools:
  projectIndex: https://docs.acquired.com/llms.txt
---

# Cancel a Direct Debit

Use this function to cancel a Direct Debit transaction if it hasn't been submitted to the banks. Any custom data supplied to this endpoint will be stored against the payment cancellation event. Please be aware that this process will fail if the transaction is not in pending status.

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "version": "0.0.9",
    "title": "Acquired API",
    "description": "Specification for the Acquired change",
    "contact": {
      "name": "Acquired",
      "url": "https://acquired.com",
      "email": "support@acquired.com"
    }
  },
  "servers": [
    {
      "url": "https://test-api.acquired.com/v1",
      "description": "Test"
    },
    {
      "url": "https://api.acquired.com/v1",
      "description": "Production"
    }
  ],
  "x-readme": {
    "explorer-enabled": false
  },
  "paths": {
    "/transactions/{transaction_id}/cancel": {
      "post": {
        "summary": "Cancel a Direct Debit",
        "description": "Use this function to cancel a Direct Debit transaction if it hasn't been submitted to the banks. Any custom data supplied to this endpoint will be stored against the payment cancellation event. Please be aware that this process will fail if the transaction is not in pending status.",
        "security": [
          {
            "token": []
          }
        ],
        "operationId": "create-a-direct-debit-cancellation",
        "tags": [
          "Direct Debit"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/transactionIdPath"
          },
          {
            "in": "header",
            "name": "Company-Id",
            "description": "Unique ID assigned by Acquired.com for your company.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Mid",
            "in": "header",
            "description": "Unique ID assigned by Acquired.com connecting to a specific acquiring bank.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "custom_data": {
                    "type": "string",
                    "description": "Enables the inclusion of extra information associated with the retry process for the collection.",
                    "example": "L3BheW1lbnQtbGlua3MgcGF5IGN1c3RvbV9kYXRh"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/http400"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/http401"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/http409"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "transactionIdPath": {
        "name": "transaction_id",
        "in": "path",
        "description": "Unique ID assigned by Acquired.com for the transaction.",
        "required": true,
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      }
    },
    "schemas": {
      "http400": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "The current status of the request.",
            "example": "error"
          },
          "error_type": {
            "type": "string",
            "description": "The type of error returned.",
            "enum": [
              "validation"
            ]
          },
          "title": {
            "type": "string",
            "description": "A human-readable message that provides more detail about the error.",
            "example": "Your request parameters did not pass our validation."
          },
          "instance": {
            "type": "string",
            "description": "Indicates where the error occurred."
          },
          "invalid_parameters": {
            "type": "array",
            "uniqueItems": true,
            "minItems": 1,
            "items": {
              "type": "object",
              "properties": {
                "parameter": {
                  "type": "string",
                  "description": "Details the parameters where the error has occurred."
                },
                "reason": {
                  "type": "string",
                  "description": "Gives detail as to what is causing the error within the parameters."
                }
              }
            }
          }
        }
      },
      "http401": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "The current status of the request.",
            "example": "error"
          },
          "error_type": {
            "type": "string",
            "description": "The type of error returned.",
            "enum": [
              "unauthorized"
            ]
          },
          "title": {
            "type": "string",
            "description": "A human-readable message that provides more detail about the error.",
            "example": "Authentication with the API failed, please check your details and try again."
          },
          "instance": {
            "type": "string",
            "description": "Indicates where the error occurred.",
            "example": "/v1/login"
          }
        }
      },
      "http409": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "The current status of the request.",
            "example": "error"
          },
          "error_type": {
            "type": "string",
            "description": "The type of error returned.",
            "enum": [
              "conflict"
            ]
          },
          "title": {
            "type": "string",
            "description": "A human-readable message that provides more detail about the error.",
            "example": "There was a conflict when trying to complete your request."
          },
          "instance": {
            "type": "string",
            "description": "Indicates where the error occurred.",
            "example": "/v1/customers"
          },
          "invalid_parameters": {
            "type": "array",
            "uniqueItems": true,
            "minItems": 0,
            "items": {
              "type": "object",
              "properties": {
                "parameter": {
                  "type": "string",
                  "description": "Details the parameters where the error has occurred."
                },
                "reason": {
                  "type": "string",
                  "description": "Gives detail as to what is causing the error within the parameters."
                }
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "token": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  }
}
```