---
updatedAt: 2026-09-17T16:50:48.000Z
agentTools:
  projectIndex: https://docs.dlocal.com/llms.txt
---

# Cancel an authorization

This service allows you to cancel an authorized transaction before it's captured.


Authorization can be cancelled before it is captured if the payment is no longer needed.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Payins",
    "version": "2.1"
  },
  "servers": [
    {
      "url": "https://api.dlocal.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "name": "X-Date",
        "in": "header",
        "x-default": ""
      },
      "sec1": {
        "type": "apiKey",
        "name": "X-Login",
        "in": "header",
        "x-default": ""
      },
      "sec2": {
        "type": "apiKey",
        "name": "X-Trans-Key",
        "in": "header",
        "x-default": ""
      },
      "sec3": {
        "type": "apiKey",
        "name": "Content-Type",
        "in": "header",
        "x-default": "application/json"
      },
      "sec4": {
        "type": "apiKey",
        "name": "X-Version",
        "in": "header",
        "x-default": "2.1"
      },
      "sec5": {
        "type": "apiKey",
        "name": "User-Agent",
        "in": "header",
        "x-default": ""
      },
      "sec6": {
        "type": "apiKey",
        "name": "Authorization",
        "in": "header",
        "x-default": ""
      }
    }
  },
  "security": [
    {
      "sec0": [],
      "sec1": [],
      "sec2": [],
      "sec3": [],
      "sec4": [],
      "sec5": [],
      "sec6": []
    }
  ],
  "paths": {
    "/payments/{authorization_id}/cancel": {
      "post": {
        "tags": [
          "Authorization"
        ],
        "summary": "Cancel an authorization",
        "description": "This service allows you to cancel an authorized transaction before it's captured.\n",
        "operationId": "cancel-an-authorization",
        "parameters": [
          {
            "name": "authorization_id",
            "in": "path",
            "description": "The Authorization ID.",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"id\": \"D-4-09f52dd0-5cfa-4b0e-a471-1608ea0dba24\",\n    \"amount\": 120,\n    \"currency\": \"USD\",\n    \"payment_method_id\": \"CARD\",\n    \"payment_method_type\": \"CARD\",\n    \"payment_method_flow\": \"DIRECT\",\n    \"country\": \"BR\",\n    \"created_date\": \"2019-02-07T17:37:36.000+0000\",\n    \"approved_date\": \"2019-02-07T17:37:36.000+0000\",\n    \"status\": \"CANCELLED\",\n    \"status_detail\": \"The payment was cancelled\",\n    \"status_code\": \"400\",\n    \"order_id\": \"be2fbac6-6114-44dc-a5f5-c4cdc38dda57\",\n    \"notification_url\": \"http://conductor.sandbox.internal/robot-server/rest/generic/notification/new\"\n} "
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "example": "D-4-09f52dd0-5cfa-4b0e-a471-1608ea0dba24"
                    },
                    "amount": {
                      "type": "number",
                      "example": 120,
                      "default": 0,
                      "format": "float"
                    },
                    "currency": {
                      "type": "string",
                      "example": "USD"
                    },
                    "payment_method_id": {
                      "type": "string",
                      "example": "CARD"
                    },
                    "payment_method_type": {
                      "type": "string",
                      "example": "CARD"
                    },
                    "payment_method_flow": {
                      "type": "string",
                      "example": "DIRECT"
                    },
                    "country": {
                      "type": "string",
                      "example": "BR"
                    },
                    "created_date": {
                      "type": "string",
                      "example": "2019-02-07T17:37:36.000+0000"
                    },
                    "approved_date": {
                      "type": "string",
                      "example": "2019-02-07T17:37:36.000+0000"
                    },
                    "status": {
                      "type": "string",
                      "example": "CANCELLED"
                    },
                    "status_detail": {
                      "type": "string",
                      "example": "The payment was cancelled"
                    },
                    "status_code": {
                      "type": "string",
                      "example": "400"
                    },
                    "order_id": {
                      "type": "string",
                      "example": "be2fbac6-6114-44dc-a5f5-c4cdc38dda57"
                    },
                    "notification_url": {
                      "type": "string",
                      "example": "http://conductor.sandbox.internal/robot-server/rest/generic/notification/new"
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "shell",
              "code": "curl -X POST \\\n   -H 'X-Date: {X-Date}' \\\n   -H 'X-Login: {X-Login}' \\\n   -H 'X-Trans-Key: {X-Trans-Key}' \\\n   -H 'Content-Type: application/json' \\\n   -H 'X-Version: 2.1' \\\n   -H 'User-Agent: MerchantTest / 1.0 ' \\\n   -H 'Authorization: V2-HMAC-SHA256, Signature: {Signature}' \\\n   -d '{body}'\n    https://api.dlocal.com/payments/D-4-09f52dd0-5cfa-4b0e-a471-1608ea0dba24/cancel    "
            }
          ],
          "samples-languages": [
            "shell"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": false,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```