# Refund **POST /transactions/refund** Process a referenced refund or void for a previously completed sale or capture transaction. If the transaction is in the current batch, the system will attempt to void it, otherwise it will be refunded resulting in a financial transaction. #### Webhook Events The following webhook events will be triggered during the refund process: - `refund.completed` - when a transaction void or refund for a previously completed transaction is completed. ## Servers - https://api.omni.integratedcommerce.io/v1: https://api.omni.integratedcommerce.io/v1 () ## Authentication methods - Api key header ## Parameters ### Body: application/json (object) The request to refund or void a previously completed transaction. - **originalTransactionId** (string) The unique transaction ID of the original transaction to be captured or refunded. This is the 'id' value returned from a previous sale or capture transaction. Use this parameter if you prefer to rely on system-generated transaction IDs rather than managing your own reference system. Either originalTransactionId or originalReferenceId must be provided. - **originalReferenceId** (string) The reference ID of the original transaction to be captured or refunded. This should match the referenceId from a previous sale, authorization, or capture transaction (either a custom reference ID you provided or one that was generated automatically by the system). Use this parameter if you want to link transactions using reference IDs rather than system transaction IDs. Either originalTransactionId or originalReferenceId must be provided. - **referenceId** (string) An optional custom reference ID for this transaction. Include this if you want to use your own reference system for linking transactions together (for example, when processing captures and refunds). If provided, this value must be unique per merchant. The reference ID can be used for processing captures and referenced refunds by including it in the originalReferenceId field of subsequent transactions. If not provided, a unique reference ID will be generated automatically by the system. - **amount** (number(uint32)) The requested amount to refund or void. If not specified, the full transaction amount will be refunded or voided. For partial refunds, must be less than the original transaction amount. If you have already performed partial refunds on this transaction, you must provide an explicit amount or an error will be returned. - **invoiceNumber** (string) An optional alphanumeric invoice number for this transaction. If provided in the request, the same value will be populated in the response. - **orderNumber** (string) An optional alphanumeric order number for this transaction. If provided, the same value will be populated in the response. ## Responses ### 200 A successful refund response #### Body: application/json (object) - **id** (string) Unique ID for this refund transaction. - **timestamp** (string(date-time)) Transaction timestamp in UTC - **type** (string) Type of transaction - **status** (string) The current status of the transaction - **accountHolder** (object) - **paymentMethod** (object) - **invoiceNumber** (string) An optional alphanumeric invoice number for this transaction. If provided in the request, the same value will be populated in the response. - **orderNumber** (string) An optional alphanumeric order number for this transaction. If provided, the same value will be populated in the response. - **referenceId** (string) The reference ID for this transaction. This will either be the reference ID provided in the transaction request or, if no value was provided, a value generated automatically by the system. This reference ID can be used for processing captures and referenced refunds by including it in the originalReferenceId field of subsequent transactions. - **resultCode** (number) Result codes: * `0` - Successful transaction request. (Check each transactionResponse's responseCode to determine if a transaction was approved or declined, card was tokenized, etc.) * `1003` - The payment terminal is busy or unavailable. (If this error persists, the user may need to close and re-open the Payment Application on the terminal or restart the terminal) * `1005` - The specified terminal could not be found. * `3000` - An unexpected error occurred. Please try again. * `3002` - The transaction could not be completed because the payment terminal could not find the related transaction. * `3005` - To resolve this error, power off your payment terminal, wait one minute and retry the transaction. If the error persists, please contact support. * `3006` - The transaction could not be completed because the payment terminal is low on battery. * `3009` - The transaction could not be completed because of network connectivity issues with the payment terminal. Please restore connectivity and try again. * `3010` - The transaction took too long and was cancelled by the application. * `3011` - Invalid transaction request. Please consult the documentation for valid transaction requests. * `3012` - Invalid transaction request. paymentMethodId is invalid. * `3013` - Invalid transaction request. The specified amount appears to be incorrect. Please retry with a smaller amount. * `3014` - Invalid amount. Please try your transaction again with an amount greater than $0. * `3020` - An unsupported transaction result was received. * `9998` - The system is not ready to process a transaction. * `9999` - An unknown error has occurred. If available, an auxiliary error code will be provided in the message. - **resultText** (string) A message describing the result code in more detail. - **requestedAmount** (number) The amount requested for refund. If not specified in the request, this will be the full transaction amount. - **approvedAmount** (number) The amount that was successfully refunded or voided. - **transactionResponses** (array[object]) A list of all transaction responses received during the refund. In most cases, there will be only one response. - **receipt** (object) ### 400 Request Error #### Body: application/json (object) - **code** (number) Numeric error code. These are grouped into ranges for easier identification and troubleshooting. * `1000` - AuthenticationGenericError * `2000` - RequestValidationGenericError * `3000` - UnknownServerGenericError * `9000` - UnhandledGenericError - **status** (string) Execution status of the request sent to the payment gateway. * Completed - The request completed successfully. * Rejected - The request was rejected by the payment gateway. No action or side effects occurred. The transaction can safely be retried. * Interrupted - The request was interrupted, and the final status is unknown. Possible side effects may have occurred (e.g., a Sale (Token) that returns Interrupted might still charge the customer, even if an error is returned). Additional checks are required before retrying the transaction. * Unknown - **message** (string) Developer-facing error message. - **traceId** (string) Unique trace identifier for tracking and debugging this request. - **timestamp** (string(date-time)) The timestamp when the error occurred (UTC). - **errorDetails** (array[object]) ### 401 Unauthorized response due to an invalid or missing API key. #### Body: application/json (object) - **code** (number) Numeric error code. These are grouped into ranges for easier identification and troubleshooting. * `1000` - AuthenticationGenericError * `2000` - RequestValidationGenericError * `3000` - UnknownServerGenericError * `9000` - UnhandledGenericError - **status** (string) Execution status of the request sent to the payment gateway. * Completed - The request completed successfully. * Rejected - The request was rejected by the payment gateway. No action or side effects occurred. The transaction can safely be retried. * Interrupted - The request was interrupted, and the final status is unknown. Possible side effects may have occurred (e.g., a Sale (Token) that returns Interrupted might still charge the customer, even if an error is returned). Additional checks are required before retrying the transaction. * Unknown - **message** (string) Developer-facing error message. - **traceId** (string) Unique trace identifier for tracking and debugging this request. - **timestamp** (string(date-time)) The timestamp when the error occurred (UTC). - **errorDetails** (array[object]) [Powered by Bump.sh](https://bump.sh)