> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tesouro.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancel a payment record



## OpenAPI

````yaml /.tooling/schemas/rest/tags/product-finops.json post /finops/v1/payment-records/{payment_record_id}/cancel
openapi: 3.1.0
info:
  title: Tesouro Partner API
  version: '2025-06-23'
  description: The Tesouro REST API, for Tesouro partners to integrate with our solution.
  termsOfService: https://tesouro.com/terms
  contact:
    name: Tesouro team
    url: https://tesouro.com/about/
    email: developers@tesouro.com
servers:
  - url: https://api.sandbox.tesouro.com
    description: Sandbox
security: []
tags:
  - name: Accounting connections
  - name: Accounting data pull
  - name: Accounting synchronized records
  - name: Accounting tax rates
  - name: Analytics
  - name: Approval policies
  - name: Approval requests
  - name: Bank details
  - name: Comments
  - name: Cost centers
  - name: Counterpart VAT IDs
  - name: Counterpart addresses
  - name: Counterpart bank accounts
  - name: Counterpart contacts
  - name: Counterparts
  - name: Credit notes
  - name: Custom tax rates
  - name: Delivery notes
  - name: Documents
  - name: Entities
  - name: Entity users
  - name: Events
  - name: Files
  - name: Identity
  - name: Ledger accounts
  - name: Mail templates
  - name: Mailbox domains
  - name: Mailboxes
  - name: Measure units
  - name: OCR
  - name: Overdue reminders
  - name: PDF templates
  - name: Payable line items
  - name: Payables
  - name: Payment intents
  - name: Payment links
  - name: Payment methods
  - name: Payment records
  - name: Payment reminders
  - name: Payment terms
  - name: Products
  - name: Projects
  - name: Purchase orders
  - name: Receipts
  - name: Receivables
  - name: Recurrences
  - name: Tags
  - name: Text templates
  - name: Transactions
  - name: VAT rates
  - name: Webhook deliveries
  - name: Webhook subscriptions
paths:
  /finops/v1/payment-records/{payment_record_id}/cancel:
    post:
      tags:
        - Payment records
      summary: Cancel a payment record
      operationId: post_payment-records_id_cancel
      parameters:
        - required: true
          schema:
            type: string
            format: date
          example: '2025-06-23'
          name: x-finops-version
          in: header
        - required: true
          schema:
            type: string
            format: uuid
          name: payment_record_id
          in: path
        - description: The ID of the entity that owns the requested resource.
          required: true
          schema:
            type: string
            format: uuid
            examples:
              - 9d2b4c8f-2087-4738-ba91-7359683c49a4
          name: x-organization-id
          in: header
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentRecordStatusUpdateRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentRecordResponse'
        '405':
          description: Method Not Allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchemaResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchemaResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    PaymentRecordStatusUpdateRequest:
      properties:
        payment_intent_status:
          type: string
          description: Raw status string of the external payment intent.
      additionalProperties: false
      type: object
    PaymentRecordResponse:
      properties:
        id:
          type: string
          format: uuid
        amount:
          type: integer
          description: >-
            Positive amount in case of successful payment, negative amount in
            case of payment failure or refund, represented in minor currency
            units (e.g., cents).
        currency:
          allOf:
            - $ref: '#/components/schemas/CurrencyEnum'
          description: >-
            Currency code (ISO 4217) indicating the currency in which the
            payment was made.
        entity_user_id:
          type: string
          format: uuid
          description: ID of the user associated with the payment, if applicable.
        history:
          items:
            $ref: '#/components/schemas/PaymentRecordHistoryResponse'
          type: array
          description: History of the payment record.
        is_external:
          type: boolean
        object:
          $ref: '#/components/schemas/PaymentRecordObjectResponse'
        overpaid_amount:
          type: integer
          minimum: 0
          description: Filled in a case, if payment amount is more, than total_amount
          default: 0
        paid_at:
          type: string
          format: date-time
          description: >-
            Timestamp marking when the payment was executed. Null if payment
            hasn't occurred yet.
        payment_intent_id:
          type: string
          format: uuid
          description: Identifier for an payment intent.
        payment_intent_status:
          type: string
          description: Raw status string of the external payment intent.
        payment_method:
          type: string
          description: Payment method used or planned for the transaction.
        planned_payment_date:
          type: string
          format: date
          description: >-
            Scheduled date for future payments, required when the payment is
            planned but not yet executed.
        status:
          type: string
          description: >-
            The current status of the payment record. Possible values:
            `created`, `processing`, `succeeded`, `canceled`.
          default: succeeded
      type: object
      required:
        - id
        - amount
        - currency
        - history
        - is_external
        - object
    ErrorSchemaResponse:
      properties:
        error:
          $ref: '#/components/schemas/ErrorSchema'
      type: object
      required:
        - error
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
      type: object
    CurrencyEnum:
      type: string
      enum:
        - AED
        - AFN
        - ALL
        - AMD
        - ANG
        - AOA
        - ARS
        - AUD
        - AWG
        - AZN
        - BAM
        - BBD
        - BDT
        - BGN
        - BHD
        - BIF
        - BMD
        - BND
        - BOB
        - BRL
        - BSD
        - BTN
        - BWP
        - BYN
        - BZD
        - CAD
        - CDF
        - CHF
        - CLP
        - CNY
        - COP
        - CRC
        - CVE
        - CZK
        - DJF
        - DKK
        - DOP
        - DZD
        - EGP
        - ETB
        - EUR
        - FJD
        - FKP
        - GBP
        - GEL
        - GHS
        - GIP
        - GMD
        - GNF
        - GTQ
        - GYD
        - HKD
        - HNL
        - HTG
        - HUF
        - IDR
        - ILS
        - INR
        - IQD
        - ISK
        - JMD
        - JOD
        - JPY
        - KES
        - KGS
        - KHR
        - KMF
        - KRW
        - KWD
        - KYD
        - KZT
        - LAK
        - LBP
        - LKR
        - LRD
        - LSL
        - LYD
        - MAD
        - MDL
        - MGA
        - MKD
        - MMK
        - MNT
        - MOP
        - MUR
        - MVR
        - MWK
        - MXN
        - MYR
        - MZN
        - NAD
        - NGN
        - NIO
        - NOK
        - NPR
        - NZD
        - OMR
        - PAB
        - PEN
        - PGK
        - PHP
        - PKR
        - PLN
        - PYG
        - QAR
        - RON
        - RSD
        - RUB
        - RWF
        - SAR
        - SBD
        - SCR
        - SEK
        - SGD
        - SHP
        - SLE
        - SOS
        - SRD
        - SSP
        - SVC
        - SZL
        - THB
        - TJS
        - TMT
        - TND
        - TOP
        - TRY
        - TTD
        - TWD
        - TZS
        - UAH
        - UGX
        - USD
        - UYU
        - UZS
        - VND
        - VUV
        - WST
        - XAF
        - XCD
        - XOF
        - XPF
        - YER
        - ZAR
        - ZMW
    PaymentRecordHistoryResponse:
      properties:
        entity_user_id:
          type: string
          format: uuid
        status:
          $ref: '#/components/schemas/PaymentRecordStatusEnum'
        timestamp:
          type: string
          format: date-time
          description: Timestamp of the change in a history
      type: object
      required:
        - status
        - timestamp
    PaymentRecordObjectResponse:
      properties:
        id:
          type: string
          format: uuid
          description: ID of the invoice
        new_status:
          type: string
          description: Status, in which object has been moved
        old_status:
          type: string
          description: Status, in which object was before payment
        type:
          $ref: '#/components/schemas/ObjectTypeEnum'
      additionalProperties: false
      type: object
      required:
        - id
        - new_status
        - old_status
        - type
    ErrorSchema:
      properties:
        message:
          type: string
      type: object
      required:
        - message
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
        msg:
          type: string
        type:
          type: string
      type: object
      required:
        - loc
        - msg
        - type
    PaymentRecordStatusEnum:
      type: string
      enum:
        - created
        - processing
        - succeeded
        - canceled
    ObjectTypeEnum:
      type: string
      enum:
        - receivable
        - payable
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````