Create transaction refund
POSTTag: api-payments-gateway-post-payin-refundDescription: Creates a partial or total refund for an already authorized or settled transactionAuthentication: Required via JWT Bearer tokenProcess: 1. Validate user authentication and input parameters 2. Verify transaction exists and belongs to the user 3. Validate transaction status (AUTHORIZED or SETTLED) 4. Confirm minimum waiting period (1 day after authorization) 5. Check if within maximum refund deadline 6. Calculate available refund amount considering previous refunds 7. Create refund request with PENDING status 8. Send for asynchronous processing to payment gatewayBusiness Rules: - Accepted statuses: AUTHORIZED (after 1 day), SETTLED - Rejected statuses: WAITING, PENDING, CANCELLED, DECLINED - Minimum period: 1 day after authorization - Maximum period: Before cancellation deadline - Maximum amount: Cannot exceed remaining available amount - Multiple refunds: Allowed until original amount is exhaustedImportant: For recent transactions (less than 1 day), use the cancellation endpoint which allows immediate reversal./v1/payin/:id/refunds
Request
Path Parameters
Unique identifier of the transaction to be refunded
<b>Format</b>: UUID v7
<b>Validation</b>: Must exist and belong to the authenticated user
Header Parameters
Sender Wallet UUID (if empty, your default Wallet UUID will be settled)
The transaction ID is a UUID (v7) used to uniquely identify the object that will be created. All objects must have an identifier.
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.
- application/json
Body
required
Possible values: <= 9007199254740991
Refund amount in cents
<b>Format</b>: Positive integer
<b>Example</b>: 10000 (equals $ 100.00)
<b>Validation</b>: Must be positive and not exceed available amount
<b>Restrictions</b>:
- Maximum: Remaining amount available for refund
- Multiple refunds: Sum cannot exceed original amount
<b>Available calculation</b>: Original amount - sum of all previous refunds
Responses
- 200
- 400
- 401
- 422
✅ Refund request created successfully
<b>Returns</b>: Created refund request object
<b>Initial status</b>: PENDING (awaiting asynchronous processing)
<b>Next steps</b>: Monitor status via webhook or subsequent query
- application/json
- Schema
- Example (from schema)
Schema
Unique identifier of the refund request Format: UUID v7 Usage: For tracking refund status Important: This is the refund ID, not the original transaction ID
Possible values: [PENDING, WAITING, ACCEPTED, DECLINED, FAILED, ERROR]
Current status of the refund request
<b>Initial value</b>: PENDING (awaiting processing)
<b>Updates</b>: Via webhook or subsequent query
<b>Flow</b>: PENDING → WAITING → ACCEPTED/DECLINED
Creation date of the refund request
Last update date of the request
{
"id": "0197b169-da6b-7ba2-b053-ce413ae39afd",
"status": "PENDING",
"created_at": "2025-12-10T22:05:25.394Z",
"updated_at": "2025-12-10T22:05:25.394Z"
}
If any required params are missing or has invalid format or type.
Authentication failed. Please provide a valid Bearer token in the Authorization header.