diff --git a/restapi_versioned_docs/version-REST API 2.29.0/restendpoints.md b/restapi_versioned_docs/version-REST API 2.29.0/restendpoints.md index 0734e2a..d57c2b7 100644 --- a/restapi_versioned_docs/version-REST API 2.29.0/restendpoints.md +++ b/restapi_versioned_docs/version-REST API 2.29.0/restendpoints.md @@ -1385,13 +1385,16 @@ This endpoint allows to Cancel/Void/Reverse a previous transaction without a rea | `Body: amount` Optional
*String* | Decimal amount in String, ISO 4217; Required for partial-reversals. *Only if your acquirer supports partial-reversals*. | | `Body: currency` Optional
*String* | Required for partial-reversals *Only if your acquirer supports partial-reversals*. | | `Body: messageReasonCode` Optional
*String* | default: CUSTOMER_CANCELLATION. See [allowed values](restobjects.md#messageReasonCode)| +| `Body: timestamp` Optional
*String* | Timestamp in `YYYYMMDDHHmmssSSS` format (17 characters). Defaults to the current server time when not provided. | **Returns** -| Response | Response Code | -| ----------- | ----------- | -| [DeferredTokenizationResponse](restobjects.md#deferredTokenizationResponse) | Response code 200. | -| **BadRequest** | Response code 400. Returned when the transaction type is not eligible for deferred tokenization. | +| Result | Notes | +| ------ | ----- | +| `200` | Reversal accepted and processed. Response body is a [ReversalResponse](restobjects.md#reversalResponse) object. | +| `400` | Business rule error from the gateway (for example, the transaction was already reversed, or a partial-reversal `amount` exceeds the original amount). Returned as `BadRequestError` with `error.code` and `error.details`. | +| `403` | Forbidden — the API key does not belong to a merchant. Partner keys are not accepted by this endpoint. | +| `422` | Payload validation error (`VALIDATION_FAILED`) — missing `originalGuid`, invalid `messageReasonCode` enum value, or invalid `currency` length. | **Code Example** diff --git a/restapi_versioned_docs/version-REST API 2.29.0/restobjects.md b/restapi_versioned_docs/version-REST API 2.29.0/restobjects.md index 12cd4a6..a5d5043 100644 --- a/restapi_versioned_docs/version-REST API 2.29.0/restobjects.md +++ b/restapi_versioned_docs/version-REST API 2.29.0/restobjects.md @@ -1052,11 +1052,11 @@ The exact shape is very similar across these operations; some fields (such as `o ## Reversal {#reversal} -### ViscusReversalRequest {#viscusReversalRequest} +### ReversalRequest {#reversalRequest} -`ViscusReversalRequest` Object +`ReversalRequest` Object -Object used by the [`POST /v1/reversal`](restendpoints#reversal-operations) endpoint to reverse any reversible transaction. Only `originalGuid` is required; all other fields are optional and default to sensible values when not provided. +Object used by the [`POST /v1/reversal`](restendpoints#reversal) endpoint to reverse any reversible transaction. Only `originalGuid` is required; all other fields are optional and default to sensible values when not provided. **Properties** @@ -1150,6 +1150,81 @@ curl --location --request POST 'https://cloud.handpoint.io/reversal' \ --- +### ReversalResponse {#reversalResponse} + +`ReversalResponse` Object + +Object returned by [`POST /v1/reversal`](restendpoints#reversal) when the reversal is accepted and processed by the gateway. + +**Properties** + +| Property | Description | +| -------- | ----------- | +| `httpStatus`
*String* | HTTP status code as returned by the gateway (for example, `"200"`). | +| `acquirerTid`
*String* | Acquirer terminal identifier used to process the reversal. | +| `agreementNumber`
*String* | Merchant agreement number used for the reversal. | +| `amount`
*String* | Amount that was reversed, in major units. Matches the original transaction amount for a full reversal, or the requested `amount` for a partial reversal. | +| `approvalCode`
*String* | Approval code returned by the issuer for the reversal. | +| `batchNumber`
*String* | Batch number the reversal was recorded against, provided the acquirer returns it. | +| `cardTypeName`
*String* | Card brand of the reversed transaction (for example, `"Visa"`). | +| `currency`
*String* | ISO 4217 3-character currency code of the reversed amount. | +| `customFields`
*Object* | Additional gateway metadata for the reversal, returned as an `entry` array of `{key, value}` pairs (for example, the applied `messageReasonCode` and `tenderType`). | +| `expiryDateMMYY`
*String* | Card expiry date in `MMYY` format. | +| `f25`
*String* | ISO 8583 field 25 (POS condition code) returned by the acquirer. | +| `issuerResponseCode`
*String* | Issuer response code for the reversal (for example, `"00"` for approved). | +| `issuerResponseText`
*String* | Human-readable description of the issuer response (for example, `"Successful"`). | +| `maskedCardNumber`
*String* | Masked PAN of the reversed transaction. | +| `serverDateTime`
*String* | Gateway server timestamp (`YYYYMMDDHHmmssSSS`) when the reversal was processed. | +| `terminalDateTime`
*String* | Terminal timestamp (`YYYYMMDDHHmmssSSS`), echoed back from the request or generated by the gateway when not provided. | +| `transactionReference`
*String* | `transactionReference` of the original transaction, echoed back for reconciliation. | +| `authorizationGuid`
*String* | GUID of the original authorization/sale being reversed. | +| `originalGuid`
*String* | GUID of the transaction that was reversed. Mirrors the `originalGuid` from the request. | +| `reversalGuid`
*String* | Unique identifier generated by the gateway for this reversal operation. | + +**Code example** + +```json +{ + "httpStatus": 200, + "acquirerTid": "ACQUIRER_TID", + "agreementNumber": "123456789010102", + "amount": "0.04", + "approvalCode": "123456", + "batchNumber": "123", + "cardTypeName": "Visa", + "currency": "USD", + "customFields": { + "entry": [ + { + "key": "messageReasonCode", + "value": "4000" + }, + { + "key": "tenderType", + "value": "Credit" + }, + { + "key": "issuerResponseCode", + "value": "00" + } + ] + }, + "expiryDateMMYY": "1027", + "f25": "4000", + "issuerResponseCode": "00", + "issuerResponseText": "Successful", + "maskedCardNumber": "************0936", + "serverDateTime": "20260709074155101", + "terminalDateTime": "20260709074155083", + "transactionReference": "ee47c0b5-ff0b-4847-977c-cb8b6c4a848c", + "authorizationGuid": "9db20c30-7b69-11f1-9754-81955277651b", + "originalGuid": "9db20c30-7b69-11f1-9754-81955277651b", + "reversalGuid": "a8534cd0-7b69-11f1-a47e-6df6451d705a" +} +``` + +--- + ## Batch {#batch} ### BatchCloseRequest {#batchCloseRequest}