# 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

## Security:

  - `BasicAuth` (unknown)
    http basic

## Query parameters:

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

  - `entity` (string, required)
    merchant entity

## Response 200:

  - `200` (unknown)
    Returns a payout resource, provided one matches the transaction and entity references.

## 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:

  - `400` (unknown)
    We could not process the request due to a client error.

## 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:

  - `401` (unknown)
    Access to the requested resource has been denied. This may occur if your entity is not configured for card payouts.

## 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:

  - `404` (unknown)
    We could not find the requested resource. Please check the `transactionReference` query parameter and try again.

## 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:

  - `422` (unknown)
    The request was syntactically valid, but couldn't be processed. For example, your merchant entity is not configured to process card payouts.

## 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

## Response 200 examples:

  - `Basic Disbursement: An existing resource is retrieved with outcome 'requestReceived'` (unknown)
    Basic Disbursement: An existing resource is retrieved with outcome 'requestReceived'

  - `Basic Disbursement: An existing resource is retrieved with outcome 'refused'` (unknown)
    Basic Disbursement: An existing resource is retrieved with outcome 'refused'

  - `Basic Disbursement: An existing resource is retrieved with outcome 'error'` (unknown)
    Basic Disbursement: An existing resource is retrieved with outcome 'error'

  - `Fast Access: An existing resource is retrieved with outcome 'requested'` (unknown)
    Fast Access: An existing resource is retrieved with outcome 'requested'

  - `Fast Access: An existing resource is retrieved with outcome 'pending'` (unknown)
    Fast Access: An existing resource is retrieved with outcome 'pending'

  - `Fast Access: An existing resource is retrieved with outcome 'approved'` (unknown)
    Fast Access: An existing resource is retrieved with outcome 'approved'

  - `Fast Access: An existing resource is retrieved with outcome 'disbursed'` (unknown)
    Fast Access: An existing resource is retrieved with outcome 'disbursed'

  - `Fast Access: An existing resource is retrieved with outcome 'refused'` (unknown)
    Fast Access: An existing resource is retrieved with outcome 'refused'

  - `Fast Access: An existing resource is retrieved with outcome 'error'` (unknown)
    Fast Access: An existing resource is retrieved with outcome 'error'

  - `Fast Access: An existing resource is retrieved with outcome 'inReview'` (unknown)
    Fast Access: An existing resource is retrieved with outcome 'inReview'

## Response 400 examples:

  - `Query parameters missing` (unknown)
    We could not process the request due to a client error. For example, one or more of the mandatory query parameters (`transactionReference` and `entity`) are missing.

## Response 401 examples:

  - `Access denied` (unknown)
    Access to the requested resource has been denied.

## Response 404 examples:

  - `Resource not found` (unknown)
    We could not find the requested resource.

## Response 422 examples:

  - `Could not process request` (unknown)
    Card payouts not enabled

