# Retrieve payout details from a historic resource

Query by transaction reference and entity to retrieve a payout.

Endpoint: GET /payouts/query
Version: 4
Security: BasicAuth

## Query parameters:

  - `transactionReference` (string, required)
    A unique reference generated by you, used to identify a payout throughout its lifecycle.
    Example: "12345"

  - `entity` (string, required)
    merchant entity
    Example: "default"

## Response 200 fields (application/vnd.worldpay.payouts-v4+json):

  - `outcome` (string, required)
    outcome of payouts query request

  - `scheme` (object)

  - `scheme.name` (string, required)
    The name of the card scheme that was used to process your payout request
    Enum: "visa", "mastercard"

  - `scheme.reference` (string)
    The reference returned by the card scheme for your payout request.
    Example: "520000000001"

  - `receivedAt` (string, required)
    A timestamp of receivedAt

## Response 400 fields (application/vnd.worldpay.payouts-v4+json):

  - `errorName` (string)
    Error name
    Example: "urlContainsInvalidValue"

  - `message` (string)
    Error message
    Example: "The URL contains a value or values that are invalid."

  - `validationErrors` (array)
    Further error details

  - `validationErrors.errorName` (string)
    Error name
    Example: "fieldIsMissing"

  - `validationErrors.message` (string)
    Error message
    Example: "A query parameter in the request is missing. This query parameter is a mandatory element of the request. The name of the query parameter is in the queryParameter field."

  - `validationErrors.queryParameter` (string)
    The name of the missing query parameter
    Example: "transactionReference"

## Response 401 fields (application/vnd.worldpay.payouts-v4+json):

  - `errorName` (string)
    Error name
    Example: "accessDenied"

  - `message` (string)
    Error message
    Example: "Access to the requested resource has been denied"

## Response 404 fields (application/vnd.worldpay.payouts-v4+json):

  - `errorName` (string)
    Error name
    Example: "resourceNotFound"

  - `message` (string)
    Error message
    Example: "The resource you are trying to access does not exist."

## Response 422 fields (application/vnd.worldpay.payouts-v4+json):

  - `errorName` (string)
    Error name
    Example: "fieldHasInvalidValue"

  - `message` (string)
    Error message
    Example: "Your merchant boarding process has not enabled payouts for this merchant entity. Please contact support, or use a valid entity."

  - `jsonPath` (string)
    Example: "$.merchant.entity"


