# Create a refund

This endpoint creates a refund for an existing transaction. Refunds are processed as referenced refunds, meaning they require a reference to the original transaction.

Endpoint: POST /refunds/search-and-refund
Version: 1.0

## Header parameters:

  - `Authorization` (string, required)

  - `Content-Type` (string, required)
    Enum: "application/json"

## Request fields (application/json):

  - `mid` (string, required)
    The merchant ID associated with the Tyro account.
    Example: "98765"

  - `transactionReference` (string, required)
    Identifier of the original transaction, as generated by the POS system or online system.

  - `originChannel` (string, required)
    The sales channel where the original transaction was processed.
    Enum: "INSTORE", "PAYMENT_LINK", "ONLINE_CHECKOUT"

  - `transactionDateTime` (string, required)
    The timestamp of when the original transaction was processed. Must be after midnight of 28th of March 2025, Sydney time (2025-03-28T00:00:00.000+11:00). The format of the date time is the notation as defined by [RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6)
    Example: "2025-10-01T12:00:00.000Z"

  - `rrn` (string)
    Retrieval Reference Number (RRN) of the original transaction to be refunded.
    Example: 393939393939

  - `refundAmount` (number, required)
    Amount to refund to the customer, in cents (AUD).
    Example: 765

  - `refundReason` (string)
    Reason for issuing the refund, stored for audit purposes.
    Example: "Customer changed their mind"

  - `partnerReference` (string)
    A reference provided by the partner to help reconcile this refund with records in their own systems.
    Example: "122121"

## Response 200 fields (application/json):

  - `refundTransactionReference` (string, required)
    Unique identifier for the refund transaction, generated by Tyro.

  - `refundTransactionRrn` (string)
    Retrieval Reference Number (RRN) associated with the refund transaction.

  - `refundAmount` (number, required)
    Amount refunded to the customer, in cents (AUD).
    Example: 765

  - `amountAvailableForRefund` (number, required)
    Remaining amount (in cents, AUD) that can still be refunded against the original transaction.
    Example: 1000

## Response 400 fields (application/json):

  - `error` (string)
    The validation error category.

  - `errorCode` (string)
    The validation error code.

  - `data` (array)
    A list of validation errors.

## Response 404 fields (application/json):

  - `error` (string)
    The validation error message.

## Response 422 fields (application/json):

  - `error` (string)

  - `errorCode` (string)
    The error code of the business validation failure. Possible values include TRANSACTION_ALREADY_REFUNDED, REFUND_AMOUNT_EXCEEDS_TRANSACTION_AMOUNT, REFUND_REJECTED.

  - `message` (string)


## Response 403 fields
