Skip to main content

Cancel payment transaction

DELETE 

/v1/payin/:id/cancel

Tag: api-payments-gateway-delete-payinDescription: Cancels an existing payment transaction within the allowed cancellation windowAuthentication: Required via JWT Bearer tokenProcess: 1. Validate user authentication and input parameters 2. Verify transaction belongs to the authenticated user 3. Validate transaction status (WAITING or AUTHORIZED) 4. Confirm within cancellation window (before cancelledMaxDate) 5. Process cancellation through payment gateway 6. Update status to CANCELLATION_IN_PROGRESS 7. Confirm cancellation and update to CANCELLED 8. Return operation confirmationBusiness Rules: - Accepted statuses: WAITING, AUTHORIZED - Rejected statuses: SETTLED, DECLINED, EXPIRED - Must be within cancellation window (before cancelledMaxDate) - Only transaction owner can cancel it - Immediate processing without waiting periodImportant: For transactions outside cancellation window, use the refund endpoint. Cancellation is for immediate operations, refund for already processed transactions.

Request

Path Parameters

    id stringrequired

    Unique identifier of the transaction to be cancelled

      <b>Format</b>: UUID v7
    <b>Validation</b>: Must exist and belong to the authenticated user
    <b>Restrictions</b>: Transaction must be in WAITING or AUTHORIZED status

Header Parameters

    x-wallet-uuid string

    Sender Wallet UUID (if empty, your default Wallet UUID will be settled)

    nonce stringrequired

    The nonce ID is a UUID (v4) used to uniquely identify the request. All requests must have an identifier.

    x-lang string

    Possible values: [pt-BR, en-US]

    Indicates the preferred language. Defaults to Brazilian Portuguese if unspecified.

    x-product-uuid string

    The product ID is a UUID (v4) used to identify the Z.ro product configuration.

    x-product-target-user-uuid string

    The product target user ID is a UUID (v4) used to identify what user account this request must be executed. Require: x-product-uuid.

Responses

Cancellation completed successfullyReturns: Transaction object with updated statusResulting status: CANCELLATION_IN_PROGRESS (processing)
Schema
    id stringrequired

    Unique identifier of the cancelled transaction

      <b>Format</b>: UUID v7
    <b>Usage</b>: For tracking and auditing the cancellation
    status stringrequired

    Possible values: [PENDING, WAITING, WAITING_THREE_DS, AUTHORIZED, EXPIRED, DECLINED, REVERTED, CANCELLATION_IN_PROGRESS, CANCELLED, SETTLED, REFUNDED, FAILED, ERROR]

    Current transaction status after cancellation

      <b>Expected</b>: CANCELLATION_IN_PROGRESS (processing)
    createdAt date-timerequired

    Original creation date of the transaction

    updatedAt date-timerequired

    Last update date of the transaction

Loading...