---
title: "Reverse a payment"
method: POST
path: "/v1/gateway-settlement/payments/{payment-key}/chargeback"
tags: ["Payment Gateway Reconciliation"]
---

# Reverse a payment

`POST /v1/gateway-settlement/payments/{payment-key}/chargeback`

If the <a href="https://docs.zuora.com?resourceId=payments-electronic-payment-processing"
target="_blank">Asynchronous Payment Statuses</a> feature is not enabled, this
API operation sets the Gateway State field of the payment to `Settled`, creates
a refund for the amount specified in the request, and returns the Refund object
as response.


If the Asynchronous Payment Statuses feature is enabled, for ACH and Bank Transfer
payments that are reversed before they are settled, this API operation sets the
Payment Status field to `Processed`, sets the Gateway State field of the payment
to `Settled`, creates an external refund for the amount specified in the request,
and returns the Refund object as response.

If the reason code "Payment Reversal" is active in the <a href="https://docs.zuora.com?resourceId=payments-creating-and-editing-reason-codes"
target="_blank">Reason Codes</a> list, the reason code of the external refund is set to "Payment Reversal". Otherwise, the default reason code in the list is used.

## Path parameters

- `payment-key` string, required

## Headers

- `Idempotency-Key` string
- `Accept-Encoding` string
- `Content-Encoding` string
- `Zuora-Track-Id` string
- `Zuora-Entity-Ids` string
- `Zuora-Org-Ids` string
- `Zuora-Version` string

## Request body

- POSTReversePaymentRequest
  - `amount` number, required — The amount that needs to be reversed (chargeback). It cannot be greater than the total Payment amount.
  - `gatewayReconciliationReason` string — The reason of gateway reconciliation.
  - `gatewayReconciliationStatus` string — The status of gateway reconciliation.
  - `gatewayResponse` string — The transaction response returned by the gateway for this transaction. If the transaction was declined, this reason is provided in the message.
  - `gatewayResponseCode` string — Response message Code returned by the gateway about the transaction status.
  - `payoutId` string — The payout ID from the gateway side.
  - `referenceId` string — Unique Id generated by the gateway for each transaction. Use this ID to find the respective Zuora Payment ID.
  - `secondReferenceId` string — The second reference Id. Some gateways use two unique transaction IDs.
  - `settledOn` string — The date and time of the transaction settlement. The format is `yyyy-mm-dd hh:mm:ss`.

## Response `200`

OK

- POSTReversePaymentResponse
  - `accountId` string — The ID of the customer account that the payment is for.
  - `amount` number, double — The total amount of the payment.
  - `cancelledOn` string, nullable — The date and time when the payment was cancelled, in `yyyy-mm-dd hh:mm:ss` format.
  - `comment` string, nullable — Comments about the payment.
  - `createdById` string — The ID of the Zuora user who created the refund.
  - `createdDate` string — The date and time when the chargeback is created, in `yyyy-mm-dd hh:mm:ss` format. For example, 2019-03-01 15:31:10.
  - `creditMemoId` string, nullable — The ID of the credit memo that is refunded.
  - `financeInformation` object — Container for the finance information related to the refund.
    - `bankAccountAccountingCode` string, nullable — The accounting code that maps to a bank account in your accounting system.
    - `bankAccountAccountingCodeType` string, nullable — The type of the accounting code that maps to a bank account in your accounting system.
    - `transferredToAccounting` 'Processing' | 'Yes' | 'No' | 'Error' | 'Ignore' — Whether the refund was transferred to an external accounting system. Use this field for integration with accounting systems, such as NetSuite.
    - `unappliedPaymentAccountingCode` string — The accounting code for the unapplied payment.
    - `unappliedPaymentAccountingCodeType` string — The type of the accounting code for the unapplied payment.
  - `gatewayId` string, nullable — The ID of the gateway instance that processes the payment.
  - `gatewayReconciliationReason` string, nullable — The reason of gateway reconciliation.
  - `gatewayReconciliationStatus` string, nullable — The status of gateway reconciliation.
  - `gatewayResponse` string, nullable — The message returned from the payment gateway for the payment. This message is gateway-dependent.
  - `gatewayResponseCode` string, nullable — The code returned from the payment gateway for the payment. This code is gateway-dependent.
  - `gatewayState` 'Submitted' | 'NotSubmitted' | 'Settled' | 'FailedToSettle' — The status of the payment in the gateway; specifically used for reconciliation.
  - `id` string — The ID of the payment chargeback.
  - `markedForSubmissionOn` string, nullable — The date and time when a charge was marked and waiting for batch submission to the payment process, in `yyyy-mm-dd hh:mm:ss` format.
  - `methodType` 'ACH' | 'Cash' | 'Check' | 'CreditCard' | 'PayPal' | 'WireTransfer' | 'DebitCard' | 'CreditCardReferenceTransaction' | 'BankTransfer' | 'Other' — How an external refund was issued to a customer.
  - `number` string — The unique identification number of the payment. For example, P-00000001.
  - `organizationLabel` string — The organization that this object belongs to. Note: This field is available only when the Multi-Org feature is enabled.
  - `paymentId` string — The ID of the payment that is refunded.
  - `paymentMethodId` string — The unique ID of the payment method that the customer used to make the payment.
  - `paymentMethodSnapshotId` string, nullable — The unique ID of the payment method snapshot which is a copy of the particular Payment Method used in a transaction.
  - `payoutId` string, nullable — The payout ID from the gateway side.
  - `reasonCode` string — A code identifying the reason for the transaction.
  - `referenceId` string, nullable — The transaction ID returned by the payment gateway for an electronic refund. Use this field to reconcile refunds between your gateway and Zuora Payments.
  - `refundDate` string, date — The date when the refund takes effect, in `yyyy-mm-dd` format. For example, 2017-03-01.
  - `refundTransactionTime` string, nullable — The date and time when the refund was issued, in `yyyy-mm-dd hh:mm:ss` format.
  - `secondRefundReferenceId` string, nullable — The transaction ID returned by the payment gateway if there is an additional refund.
  - `settledOn` string — The date and time when the transaction is settled, in `yyyy-mm-dd hh:mm:ss` format.
  - `softDescriptor` string, nullable — A payment gateway-specific field that maps Zuora to other gateways.
  - `softDescriptorPhone` string, nullable — A payment gateway-specific field that maps Zuora to other gateways.
  - `status` string — The status of the payment.
  - `submittedOn` string, nullable — The date and time when the payment was submitted, in yyyy-mm-dd hh:mm:ss format.
  - `success` boolean — Returns `true` if the request was processed successfully.
  - `type` 'External' | 'Electronic' — The type of the payment.
  - `updatedById` string — The ID of the Zuora user who last updated the payment.
  - `updatedDate` string — The date and time when the payment was last updated, in `yyyy-mm-dd hh:mm:ss` format. For example, 2019-03-02 15:36:10.

## Other responses

- `500` — Internal Server Error
- `4XX` — Request Errors

---

[API](https://skmtc.dev/zuora/apis/api-reference.md) · [All operations](https://skmtc.dev/zuora/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/zuora/api-reference/revisions/d11e237f3e54/schema)
