Cancel payment transaction
DELETETag: 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./v1/payin/:id/cancel
Request
Path Parameters
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
Sender Wallet UUID (if empty, your default Wallet UUID will be settled)
The nonce ID is a UUID (v4) used to uniquely identify the request. All requests must have an identifier.
Possible values: [pt-BR, en-US]
Indicates the preferred language. Defaults to Brazilian Portuguese if unspecified.
The product ID is a UUID (v4) used to identify the Z.ro product configuration.
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
- 200
- 400
- 401
- 422
- application/json
- Schema
- Example (from schema)
Schema
Unique identifier of the cancelled transaction
<b>Format</b>: UUID v7
<b>Usage</b>: For tracking and auditing the cancellation
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)
Original creation date of the transaction
Last update date of the transaction
{
"id": "0197b169-da6b-7ba2-b053-ce413ae39afd",
"status": "CANCELLATION_IN_PROGRESS",
"createdAt": "2023-01-01T10:00:00.000Z",
"updatedAt": "2023-01-01T11:00:00.000Z"
}
If any required params are missing or has invalid format or type.
Authentication failed. Please provide a valid Bearer token in the Authorization header.