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

# Void an authorized payment

> Cancel an `AUTHORIZED` payment before capture.



## OpenAPI

````yaml /v3-beta/api-reference/openapi.yaml post /v3/payments/{id}/void
openapi: 3.1.0
info:
  title: Suby.fi Merchant API
  version: 3.0.0-beta
  description: >
    The **v3** public merchant API for Suby.fi. RESTful (plural,
    resource-oriented

    endpoints under the `/v3` prefix). Authenticate every request

    with your secret API key in the `X-Suby-Api-Key` header.


    - `sk_live_…` keys operate in **production** (real funds).

    - `sk_sandbox_…` keys operate in a fully simulated **sandbox** (test cards,
      Base Sepolia crypto, no real money). The environment is derived from the
      key prefix.

    All monetary amounts are **integer cents** (except `priceCents` on some

    read shapes, which is a string) — token amounts are strings in the smallest

    unit (sats / lamports / wei). Fees are basis points.
  contact:
    email: dev@suby.fi
    url: https://suby.fi
servers:
  - url: https://api.beta.suby.fi
    description: Production + sandbox (environment selected by API key prefix)
security:
  - ApiKeyAuth: []
tags:
  - name: Products
    description: Manage your product catalog (one-time and recurring).
  - name: Checkout
    description: >-
      Hosted checkout — signed session tokens (`cs_…`) plus branding and
      appearance settings.
  - name: Payments
    description: >-
      Create, capture, void, and retrieve one-time & off-session payments (card,
      APM, and crypto).
  - name: Subscriptions
    description: Start and cancel recurring subscriptions.
  - name: Customers
    description: First-class customer records with billing address.
  - name: Payment Methods
    description: >-
      Save a payment method to a customer and manage saved instruments for
      off-session charges.
  - name: Webhook Endpoints
    description: Register outbound webhook destinations and rotate signing secrets.
  - name: Analytics
    description: Org-wide revenue analytics.
  - name: Health
    description: Unauthenticated liveness probe.
paths:
  /v3/payments/{id}/void:
    post:
      tags:
        - Payments
      summary: Void an authorized payment
      description: Cancel an `AUTHORIZED` payment before capture.
      operationId: voidPayment
      parameters:
        - $ref: '#/components/parameters/PaymentId'
      responses:
        '200':
          description: Voided (status `CANCELED`, or `PENDING` pending webhook)
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessEnvelope'
                  - properties:
                      data:
                        type: object
                        properties:
                          payment:
                            $ref: '#/components/schemas/Payment'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          description: Not voidable (e.g. `PAYMENT_NOT_VOIDABLE`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    PaymentId:
      name: id
      in: path
      required: true
      schema:
        type: string
        example: pay_abc123
  schemas:
    SuccessEnvelope:
      type: object
      required:
        - success
        - data
      properties:
        success:
          type: boolean
          example: true
        message:
          type: string
        data:
          description: Endpoint-specific payload.
    Payment:
      type: object
      description: Public payment shape (`PaymentPublic`).
      properties:
        id:
          type: string
          example: pay_abc123
        organizationId:
          type: string
        customerId:
          type: string
          nullable: true
        productId:
          type: string
          nullable: true
        subscriptionId:
          type: string
          nullable: true
        status:
          $ref: '#/components/schemas/PaymentStatus'
        declineCode:
          type: string
          nullable: true
          description: >-
            Normalized decline reason for a FAILED charge (Stripe-parity
            `decline_code`), e.g. `insufficient_funds`, `not_supported`,
            `stolen_card`, `expired_card`. Null on non-declined / non-card
            payments.
        declineCategory:
          type: string
          nullable: true
          enum:
            - SOFT
            - HARD
          description: >-
            Retryability of the decline: SOFT = transient (a retry may succeed),
            HARD = terminal (the credential is unusable). Null when not a
            decline.
        displayName:
          type: string
          nullable: true
        displayDescription:
          type: string
          nullable: true
        displayImageUrl:
          type: string
          nullable: true
        priceCents:
          type: string
          nullable: true
        currency:
          type: string
          nullable: true
        tokenAmount:
          type: string
          nullable: true
        tokenFeeAmount:
          type: string
          nullable: true
        quoteFiatAmountCents:
          type: integer
          nullable: true
        quoteFiatCurrency:
          type: string
          nullable: true
        grossAmountCents:
          type: integer
          nullable: true
        platformFeeCents:
          type: integer
          nullable: true
        merchantNetCents:
          type: integer
          nullable: true
        vatAmountCents:
          type: integer
          nullable: true
        vatRateBps:
          type: integer
          nullable: true
          description: >-
            Applied VAT rate in basis points (2000 = 20%); MoR + EU only, else
            null
        taxInclusive:
          type: boolean
          description: >-
            true = price is VAT-inclusive (gross = price); false = exclusive
            (gross = price + VAT)
        refundedAmountCents:
          type: integer
          nullable: true
        refundedAt:
          type: string
          format: date-time
          nullable: true
        cryptoSettlementMode:
          type: string
          nullable: true
        settlementChainId:
          type: integer
          nullable: true
        settlementAsset:
          type: string
          nullable: true
        settlementRecipient:
          type: string
          nullable: true
        depositAddress:
          type: string
          nullable: true
        settlementTxHash:
          type: string
          nullable: true
        successUrl:
          type: string
          nullable: true
        cancelUrl:
          type: string
          nullable: true
        externalRef:
          type: string
          nullable: true
        paymentReceivedAt:
          type: string
          format: date-time
          nullable: true
        paymentSettledAt:
          type: string
          format: date-time
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        expiresAt:
          type: string
          format: date-time
          nullable: true
          description: >-
            When an unfinished intent stops being payable. Set for card/APM
            (bounded to the checkout-session window, else 30 min) and crypto
            (per-chain deposit window). Past this, an abandoned PENDING intent
            is swept to EXPIRED. Null only for legacy rows.
        statusTimeline:
          type: array
          description: >-
            Append-only status history — every status the payment moved through,
            oldest→newest. The last entry is where it currently stands /
            stopped. Populated on detail + list reads; empty for legacy rows
            created before the feature.
          items:
            type: object
            properties:
              status:
                type: string
                description: The status the payment transitioned into.
                enum:
                  - PENDING
                  - AUTHORIZED
                  - PENDING_3DS
                  - PENDING_REDIRECT
                  - BRIDGING
                  - RECEIVED
                  - PARTIAL
                  - COMPLETED
                  - FAILED
                  - DECLINED
                  - REFUNDED
                  - PARTIALLY_REFUNDED
                  - CANCELED
                  - EXPIRED
              at:
                type: string
                format: date-time
                description: When the transition happened.
        asset:
          type: object
          nullable: true
          description: Populated on crypto reads.
          properties:
            chainId:
              type: integer
            symbol:
              type: string
            decimals:
              type: integer
            address:
              type: string
              description: Token contract / SPL mint, or `NATIVE`.
        deposit:
          type: object
          nullable: true
          description: Populated on crypto reads while a deposit is being watched.
          properties:
            expected:
              type: string
            received:
              type: string
            remaining:
              type: string
            confirmations:
              type: object
              nullable: true
              properties:
                observed:
                  type: integer
                required:
                  type: integer
                detectedAt:
                  type: string
                  format: date-time
            warnings:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - INSUFFICIENT_DEPOSIT_AMOUNT
                      - RBF_DETECTED
                      - NETWORK_FEE_SURCHARGE
                  message:
                    type: string
                  data:
                    type: object
                    additionalProperties: true
    Error:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          description: Machine-readable error code.
          example: NOT_FOUND
        message:
          type: string
          example: Resource not found
        data:
          description: Optional error detail.
    PaymentStatus:
      type: string
      enum:
        - PENDING
        - AUTHORIZED
        - PENDING_3DS
        - PENDING_REDIRECT
        - BRIDGING
        - RECEIVED
        - PARTIAL
        - COMPLETED
        - FAILED
        - DECLINED
        - REFUNDED
        - PARTIALLY_REFUNDED
        - CANCELED
        - EXPIRED
  responses:
    Unauthorized:
      description: Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            error: UNAUTHORIZED
            message: Invalid or missing API key
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            error: NOT_FOUND
            message: Resource not found
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Suby-Api-Key
      description: Secret API key. `sk_live_…` (production) or `sk_sandbox_…` (sandbox).

````