---
agentTools:
  projectIndex: https://paytech.readme.io/llms.txt
---

# /api/v1/payments/{id}/void

Void a Pre-Authorized payment. Only a payment in AUTHORIZED state can be voided. The payment will be transferred to CANCELLED state and will no longer be available for capturing.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "pay.tech API",
    "description": "Payment API\n",
    "contact": {
      "name": "Support",
      "email": "support@pay.tech"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "version": ""
  },
  "servers": [
    {
      "url": "https://engine-sandbox.pay.tech",
      "description": "Sandbox"
    },
    {
      "url": "https://engine.pay.tech",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "Payment",
      "description": "Merchant Payments API"
    }
  ],
  "paths": {
    "/api/v1/payments/{id}/void": {
      "post": {
        "tags": [
          "Payment"
        ],
        "description": "Void a Pre-Authorized payment. Only a payment in AUTHORIZED state can be voided. The payment will be transferred to CANCELLED state and will no longer be available for capturing.",
        "operationId": "voidPayment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Payment Id",
            "required": true,
            "schema": {
              "pattern": "/[a-zA-Z0-9]{32}/",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payment response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuthentication": []
          }
        ],
        "x-codegen-request-body-name": "body"
      }
    }
  },
  "components": {
    "schemas": {
      "PaymentMethodDetails": {
        "type": "object",
        "properties": {
          "customerAccountNumber": {
            "maxLength": 256,
            "type": "string",
            "description": "Customer account Id in external system or masked card PAN",
            "example": "400000***0002"
          },
          "cardToken": {
            "maxLength": 32,
            "type": "string",
            "description": "Card token which can be used instead of full card number (for BASIC_CARD payment method only)",
            "example": "3529d42227424875af8722cbf54d7073"
          },
          "cardholderName": {
            "maxLength": 128,
            "type": "string",
            "description": "Cardholder name (for BASIC_CARD payment method only)",
            "example": "John Doe"
          },
          "cardExpiryMonth": {
            "minLength": 2,
            "maxLength": 2,
            "type": "string",
            "description": "Card expiration month (for BASIC_CARD payment method only)",
            "example": "01"
          },
          "cardExpiryYear": {
            "minLength": 4,
            "maxLength": 4,
            "type": "string",
            "description": "Card expiration year (for BASIC_CARD payment method only)",
            "example": "2023"
          },
          "cardIssuingCountryCode": {
            "minLength": 2,
            "maxLength": 2,
            "type": "string",
            "description": "Card issuing country code (for BASIC_CARD payment method only)",
            "example": "CY"
          }
        }
      },
      "BillingAddress": {
        "type": "object",
        "properties": {
          "addressLine1": {
            "maxLength": 50,
            "type": "string",
            "description": "Line 1 of the address (e.g., Number, street, etc)",
            "example": "7, Sunny street"
          },
          "addressLine2": {
            "maxLength": 50,
            "type": "string",
            "description": "Line 2 of the address (e.g., Suite, apt)",
            "example": "Office 3"
          },
          "city": {
            "maxLength": 50,
            "type": "string",
            "description": "City name",
            "example": "Limassol"
          },
          "countryCode": {
            "maxLength": 2,
            "minLength": 2,
            "pattern": "[A-Z]{2}",
            "type": "string",
            "description": "2-character IS0-3166-1 country code",
            "example": "CY"
          },
          "postalCode": {
            "maxLength": 12,
            "type": "string",
            "description": "Postal code",
            "example": "4141"
          },
          "state": {
            "maxLength": 40,
            "type": "string",
            "description": "State code",
            "example": "CA"
          }
        },
        "description": "Customer's billing address"
      },
      "Customer": {
        "type": "object",
        "properties": {
          "referenceId": {
            "maxLength": 128,
            "type": "string",
            "description": "Id of the customer assigned by Merchant",
            "example": "customer_123"
          },
          "citizenshipCountryCode": {
            "maxLength": 2,
            "minLength": 2,
            "type": "string",
            "description": "Customer country of citizenship",
            "example": "AU"
          },
          "firstName": {
            "maxLength": 128,
            "type": "string",
            "example": "John"
          },
          "lastName": {
            "maxLength": 128,
            "type": "string",
            "example": "Smith"
          },
          "dateOfBirth": {
            "maxLength": 10,
            "minLength": 10,
            "type": "string",
            "format": "ISO 8601 (YYYY-MM-DD)",
            "example": "2001-12-03"
          },
          "email": {
            "maxLength": 256,
            "type": "string",
            "description": "Email address of the customer",
            "format": "email",
            "example": "my@email.com"
          },
          "phone": {
            "maxLength": 18,
            "type": "string",
            "description": "International phone number of the customer, without the '+'. Use a space as a separator between the dialing country code and local phone number.",
            "example": "357 123123123"
          },
          "locale": {
            "maxLength": 2,
            "minLength": 2,
            "type": "string",
            "description": "Customer preferred display language",
            "example": "ru"
          },
          "accountNumber": {
            "maxLength": 256,
            "type": "string",
            "description": "Customer account number in the provider's system. Used for some types of withdrawals."
          },
          "accountName": {
            "maxLength": 64,
            "type": "string",
            "description": "Customer account name in the provider's system. Used for some types of withdrawals."
          },
          "bank": {
            "maxLength": 64,
            "type": "string",
            "description": "Customer bank. Used for some types of withdrawals."
          },
          "bankBranch": {
            "maxLength": 64,
            "type": "string",
            "description": "Customer bank branch. Used for some types of withdrawals."
          },
          "documentType": {
            "$ref": "#/components/schemas/DocumentType"
          },
          "documentNumber": {
            "maxLength": 64,
            "type": "string",
            "description": "An identifier for the customer assigned by a government authority"
          },
          "routingGroup": {
            "maxLength": 64,
            "type": "string",
            "description": "Identify the customer as belonging to a specific group that is used for routing",
            "example": "VIP"
          },
          "kycStatus": {
            "type": "boolean",
            "description": "Indicates whether the customer has passed KYC verification",
            "example": true
          },
          "paymentInstrumentKycStatus": {
            "type": "boolean",
            "description": "Indicates whether the payment instrument (usually the card number) has passed KYC verification",
            "example": true
          },
          "dateOfFirstDeposit": {
            "type": "string",
            "format": "ISO 8601 (YYYY-MM-DD)",
            "description": "Date of the first deposit from the customer",
            "example": "2021-01-01"
          },
          "depositsAmount": {
            "type": "integer",
            "description": "How much the customer has deposited, in base currency",
            "example": 5000
          },
          "withdrawalsAmount": {
            "type": "integer",
            "description": "How much the customer has withdrawn, in base currency",
            "example": 1000
          },
          "depositsCnt": {
            "type": "integer",
            "description": "How many times the customer made a deposit",
            "example": 5000
          },
          "withdrawalsCnt": {
            "type": "integer",
            "description": "How many times the customer made a withdrawal",
            "example": 1000
          }
        }
      },
      "Result": {
        "properties": {
          "id": {
            "maxLength": 32,
            "type": "string",
            "description": "Payment Id",
            "example": "91d27876e87f4b22b3ecd53924bf973d"
          },
          "referenceId": {
            "maxLength": 256,
            "type": "string",
            "description": "referenceId from payment request",
            "example": "payment-123"
          },
          "created": {
            "type": "string",
            "format": "ISO 8601 (YYYY-MM-DD'T'HH24:MI:SS)",
            "description": "Date and time when this payment was created, in UTC time zone",
            "example": "2030-12-25T10:11:12"
          },
          "paymentType": {
            "$ref": "#/components/schemas/PaymentType"
          },
          "state": {
            "$ref": "#/components/schemas/PaymentState"
          },
          "description": {
            "maxLength": 512,
            "type": "string",
            "description": "Description of the transaction",
            "example": "Deposit via TEST shop"
          },
          "parentPaymentId": {
            "maxLength": 32,
            "type": "string",
            "description": "Initial transaction Id from payment request",
            "example": "91d27876e87f4b22b3ecd53924bf973d"
          },
          "paymentMethod": {
            "$ref": "#/components/schemas/PaymentMethod"
          },
          "paymentMethodDetails": {
            "$ref": "#/components/schemas/PaymentMethodDetails"
          },
          "amount": {
            "multipleOf": 1e-18,
            "maximum": 999999.99,
            "exclusiveMaximum": false,
            "minimum": 1e-18,
            "exclusiveMinimum": false,
            "type": "number",
            "description": "Amount sent to the payment provider",
            "example": 11.12
          },
          "currency": {
            "type": "string",
            "description": "Currency sent to the payment provider",
            "format": "ISO 4217 code for FIAT currencies or cryptocurrency symbol",
            "example": "EUR"
          },
          "customerAmount": {
            "type": "number",
            "description": "Amount from payment request. Filled only if the request currency differs from the currency sent to the payment provider.",
            "example": 15
          },
          "customerCurrency": {
            "type": "string",
            "description": "Currency from payment request. Filled only if it differs from the currency sent to the payment provider.",
            "format": "ISO 4217 code for FIAT currencies or cryptocurrency symbol",
            "example": "USD"
          },
          "redirectUrl": {
            "maxLength": 256,
            "type": "string",
            "description": "URL to redirect the customer",
            "example": "http://start/payment/6ccaa03cb2c242a68ce332f38fedfad7"
          },
          "errorCode": {
            "type": "string",
            "description": "Check 'Error Codes' section for details",
            "example": "4.01"
          },
          "errorMessage": {
            "type": "string",
            "description": "Check 'Error Codes' section for details",
            "example": "Insufficient Funds"
          },
          "externalResultCode": {
            "type": "string",
            "description": "Result code from external provider",
            "example": "03"
          },
          "customer": {
            "$ref": "#/components/schemas/Customer"
          },
          "billingAddress": {
            "$ref": "#/components/schemas/BillingAddress"
          },
          "startRecurring": {
            "type": "boolean",
            "description": "Indicates whether this payment has started a recurring chain"
          },
          "preAuth": {
            "type": "boolean",
            "description": "Indicates whether this is a Pre-Authorization request (for 2-phase deposit)"
          },
          "recurringToken": {
            "type": "string",
            "description": "Token that can be used to continue the recurring chain"
          },
          "terminalName": {
            "type": "string",
            "description": "The name of the provider that was used to process this payment"
          },
          "externalFeeAmount": {
            "type": "number",
            "description": "Provider fee. Filled only if supported by the provider.",
            "example": 15
          },
          "externalFeeCurrency": {
            "type": "string",
            "description": "Provider fee currency. Filled only if supported by the provider.",
            "format": "ISO 4217 code for FIAT currencies or cryptocurrency symbol",
            "example": "USD"
          }
        }
      },
      "PaymentResponse": {
        "type": "object",
        "properties": {
          "timestamp": {
            "type": "string",
            "format": "ISO 8601",
            "example": "2020-10-07T13:36:32.595Z"
          },
          "status": {
            "type": "integer",
            "description": "HTTP status code",
            "example": 200
          },
          "result": {
            "$ref": "#/components/schemas/Result"
          }
        }
      },
      "UnauthorizedError": {
        "required": [
          "status",
          "error",
          "message",
          "timestamp",
          "path"
        ],
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "example": 401
          },
          "error": {
            "type": "string",
            "example": "Unauthorized"
          },
          "message": {
            "type": "string",
            "example": "Invalid token"
          },
          "timestamp": {
            "type": "string",
            "format": "ISO 8601",
            "example": "2020-10-07T13:32:19.444Z"
          },
          "path": {
            "type": "string",
            "example": "/api/v1/payments"
          }
        },
        "example": {
          "status": 401,
          "error": "Unauthorized",
          "message": "Invalid token",
          "timestamp": "2020-10-07T13:32:19.444Z",
          "path": "/api/v1/resource-name"
        }
      },
      "PaymentType": {
        "type": "string",
        "description": "Payment Type",
        "example": "DEPOSIT",
        "enum": [
          "DEPOSIT",
          "WITHDRAWAL",
          "REFUND"
        ]
      },
      "PaymentMethod": {
        "type": "string",
        "description": "Payment Method",
        "example": "BASIC_CARD",
        "enum": [
          "BASIC_CARD",
          "CRYPTO",
          "FLEXEPIN",
          "MACROPAY",
          "SKRILL",
          "PAYRETAILERS",
          "LOCALPAYMENT",
          "MONNET",
          "PAYPAL",
          "NETELLER",
          "TRUSTPAYMENTS",
          "PAYMAXIS",
          "GATE8TRANSACT",
          "TINK",
          "B2BINPAY",
          "CLICK",
          "MONETIX",
          "PERFECTMONEY",
          "VOLT",
          "KESSPAY",
          "BILLLINE",
          "NGENIUS",
          "ASTROPAY",
          "ALYCEPAY",
          "PIX",
          "BOLETO",
          "UPI",
          "PAYTM",
          "NETBANKING",
          "FINRAX",
          "SPOYNT",
          "XINPAY",
          "OMNIMATRIX",
          "DPOPAY",
          "EXTERNAL_HPP",
          "XANPAY",
          "INRPAY",
          "ARI10",
          "SOFORT",
          "GIROPAY",
          "PAYSAFECARD",
          "PAYSAFECASH",
          "OPEN_BANKING",
          "KLARNA",
          "SPEI",
          "PAYCASH",
          "RAPIPAGO",
          "PAGOFACIL",
          "RAPIDTRANSFER",
          "MOBILE_MONEY",
          "INTERAC",
          "INTERAC_ETO",
          "INTERAC_RTO",
          "INTERAC_ACH",
          "PICPAY",
          "MOLLIE",
          "TED",
          "ZIPAY",
          "PSE",
          "EFECTY",
          "BANKTRANSFER",
          "PEC",
          "OXXO",
          "WEBPAY",
          "PAGOEFECTIVO",
          "MIFINITY",
          "PAYPORT",
          "JETONCASH",
          "JETONWALLET",
          "NEOSURF",
          "NODA",
          "NODA_REVOLUT",
          "ALFAKIT",
          "PAYFUN",
          "EMANAT",
          "M10",
          "RUBPAY",
          "MONERCHY",
          "MUCHBETTER",
          "YAPILY",
          "INAI",
          "IMPS",
          "RTGS",
          "PAYID",
          "ZOTAPAY",
          "SBP",
          "P2P_CARD",
          "P2P_IBAN",
          "P2P_SBP",
          "P2P_MOBILE",
          "P2P_M10",
          "P2P_EMANAT",
          "PUSH",
          "GATEIQ",
          "VIETTEL",
          "ZALO",
          "QR",
          "CUP",
          "CODI",
          "PAY2PLAY",
          "BKASH",
          "NAGAD",
          "ROCKET",
          "VIRTUAL_ACCOUNT",
          "MULTIBANCO",
          "BLIK",
          "MBWAY",
          "P24",
          "MISTERCASH",
          "MACH",
          "KHIPU",
          "NEFT",
          "STICPAY",
          "SBERPAY",
          "MOBILE_COMMERCE",
          "BINANCE_PAY",
          "MPAY",
          "CHEK",
          "KLAP_EFECTIVO",
          "KLAP_TRANSFERENCIA",
          "PAGO46",
          "HITES",
          "SERVIFACIL",
          "OPENPAYD",
          "FAWRY",
          "EPS",
          "IDEAL",
          "TRUSTLY",
          "USSD",
          "MPESA",
          "ENAIRA",
          "ONEVOUCHER",
          "BANCONTACT",
          "SWISH",
          "EFT",
          "GCASH",
          "PAYMAYA",
          "PAGO_MOVIL",
          "PAGO_MOVIL_INST",
          "BIOPAGO",
          "CASH",
          "VOUCHERRY",
          "SOFT2PAY",
          "APPLEPAY",
          "GOOGLEPAY",
          "BRITE",
          "VOUCHSTAR",
          "REVOLUT",
          "ONLINE_BANKING",
          "PROMPTPAY",
          "TRUEMONEY",
          "MOMOPAY_VN",
          "MOMOPAY_RW",
          "VNPAY_QR",
          "N26",
          "WISE",
          "PAYDO_WALLET",
          "PAPARA",
          "PAYPAY",
          "PARAZULA",
          "PAYFIX",
          "PHONEPE",
          "CIP",
          "BASIC_CARD_HPP",
          "WAVE",
          "PIASTRIX",
          "DANA",
          "SHOPEEPAY",
          "QRIS",
          "OVO",
          "ALFAMART",
          "GOPAY",
          "PAYOUT_SEPA_BATCH",
          "PAYOUT_NONSEPA_REQUEST"
        ]
      },
      "PaymentState": {
        "type": "string",
        "description": "Payment State",
        "example": "PENDING",
        "enum": [
          "CHECKOUT",
          "PENDING",
          "AUTHORIZED",
          "CANCELLED",
          "DECLINED",
          "COMPLETED"
        ]
      },
      "DocumentType": {
        "type": "string",
        "description": "Document Type",
        "example": "BR_CPF",
        "enum": [
          "AR_CDI",
          "AR_CUIL",
          "AR_CUIT",
          "AR_DNI",
          "AR_OTRO",
          "BR_CNPJ",
          "BR_CPF",
          "BR_PP",
          "CL_CI",
          "CL_OTRO",
          "CL_PP",
          "CL_RUN",
          "CL_RUT",
          "CO_CC",
          "CO_CE",
          "CO_DL",
          "CO_DNI",
          "CO_NE",
          "CO_NIT",
          "CO_PP",
          "CO_SS",
          "CO_TI",
          "CO_TIN",
          "CR_CDI",
          "EC_CC",
          "EC_DNI",
          "EC_PP",
          "EC_RUC",
          "GT_CUI",
          "GT_DPI",
          "GT_NIT",
          "IN_DL",
          "IN_ID",
          "IN_UID",
          "MX_CURP",
          "MX_IFE",
          "MX_PP",
          "MX_RFC",
          "PA_CIP",
          "PE_CE",
          "PE_CPP",
          "PE_DNI",
          "PE_OTRO",
          "PE_PP",
          "PE_RUC",
          "VN_TIN"
        ]
      },
      "Error": {
        "type": "object",
        "example": {
          "timestamp": "2020-10-07T13:31:17.110+00:00",
          "status": 400,
          "error": "Bad Request",
          "message": "Validation failed for object='paymentRequest'. Error count: 1",
          "errors": [
            {
              "codes": [
                "NotNull.paymentRequest.currency",
                "NotNull.currency",
                "NotNull.java.util.Currency",
                "NotNull"
              ],
              "arguments": [
                {
                  "codes": [
                    "paymentRequest.currency",
                    "currency"
                  ],
                  "defaultMessage": "currency"
                }
              ],
              "defaultMessage": "must not be null",
              "objectName": "paymentRequest",
              "field": "currency",
              "bindingFailure": false
            }
          ],
          "path": "/api/v1/payments"
        },
        "properties": {
          "timestamp": {
            "type": "string"
          },
          "status": {
            "type": "number"
          },
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "codes": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "arguments": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "codes": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "defaultMessage": {
                        "type": "string"
                      }
                    }
                  }
                },
                "defaultMessage": {
                  "type": "string"
                },
                "objectName": {
                  "type": "string"
                },
                "field": {
                  "type": "string"
                },
                "bindingFailure": {
                  "type": "boolean"
                }
              }
            }
          },
          "path": {
            "type": "string"
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuthentication": {
        "type": "http",
        "description": "The client sends HTTP requests with the Authorization header that contains the word Bearer followed by a space and the Shop Api Key.",
        "scheme": "bearer"
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 101,
      "1": 45,
      "2": 69,
      "3": 133,
      "4": 174,
      "5": 147,
      "6": 179,
      "7": 8,
      "8": 208,
      "9": 63,
      "10": 103,
      "11": 68
    }
  }
}
```