# Query historical payments

Query payments processed before 25 June 2024.

Provide a transactionReference and entityReference for a payment to find the matching payment in the archive.

Endpoint: GET /paymentQueries/archivedPayments
Version: 1
Security: BasicAuth

## Header parameters:

  - `Accept` (string, required)
    Example: "application/vnd.worldpay.payment-queries-v1.hal+json"

## Query parameters:

  - `transactionReference` (string, required)
    A unique reference generated by you, used to identify a payment throughout its lifecycle.
    Example: "89197aeb-c94a-456e-8014-1272fbcb64eb"

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

## Response 200 fields (application/vnd.worldpay.payment-queries-v1.hal+json):

  - `_links` (object, required)
    Self link and next action links. The next action links are dependent on the lastEvent. Refer to the 'query for historical payments response' section for more details.

  - `_links.self` (object, required)
    Self link to the page.

  - `_links.self.href` (string)
    Self link to the page.

  - `_links.payments:cancel` (object)
    Next action links.

  - `_links.payments:cancel.href` (string)
    Next action links.

  - `_links.payments:settle` (object)
    Next action links.

  - `_links.payments:settle.href` (string)
    Next action links.

  - `_links.payments:partialSettle` (object)
    Next action links.

  - `_links.payments:partialSettle.href` (string)
    Next action links.

  - `_embedded` (object, required)

  - `_embedded.payments` (array)
    Array of payments.

  - `_embedded.payments.lastEvent` (string)
    The last event of a payment. Possible event values are:AuthorizedRefusedSent for CancellationSent for RefundSent for SettlementUnknown

  - `_embedded.payments.paymentInstrument` (object)
    An object that contains information about the payment type.

  - `_embedded.payments.paymentInstrument.type` (string)
    The type of payment instrument used for this payment.
    Enum: "card/plain", "card/token", "card/checkout", "card/wallet+applepay", "card/wallet+googlepay", "card/networkToken", "card/networkToken+applepay", "card/networkToken+googlepay", "card/network", "card/plain+masked", "card/network+masked"

  - `_embedded.payments.paymentInstrument.card` (object)
    An object that contains information about the card used.

  - `_embedded.payments.paymentInstrument.card.number` (object)
    An object that contains information about the card number.

  - `_embedded.payments.paymentInstrument.card.number.cardBin` (string)
    The card BIN (Bank Identification Number) is the first 6 or 8 digits of the card number, and can be used to identify the card issuer, the card brand(s) (e.g. Visa, Cartes Bancaires), and the country. Card BINs are used to route transactions, check card capabilities, and in fraud assessments.
    Example: "444433"

  - `_embedded.payments.paymentInstrument.card.number.last4Digits` (string)
    The last four digits of the card. Some characters may be obfuscated with a * if the PAN length is less than 16 characters.
    Example: "1111"

  - `_embedded.payments.paymentInstrument.card.number.fpanLastFour` (string)
    {% admonition type="warning" name="Coming soon" %}Preview only. Not yet available in production.{% /admonition %}
The last four digits of the actual card, where this was submitted in an authorization request that used a network token or a [mobile wallet](/products/wallets#submitting-card-metadata-to-worldpay) (encrypted or decrypted) paymentInstrument. Commonly referred to as the Funding Primary Account Number (FPAN).
    Example: "1111"

  - `_embedded.payments.paymentInstrument.card.category` (string)
    Whether the card is classed as a consumer card or a card for commercial use.
    Enum: "commercial", "consumer"

  - `_embedded.payments.paymentInstrument.card.countryCode` (string)
    The [ISO 3166-1 Alpha-2 format](/products/reference/supported-countries-currencies#iso-country-codes) country code that the card was issued in. May return N/A where the country is unknown.
    Example: "GB"

  - `_embedded.payments.paymentInstrument.card.expiryDate` (object)
    The expiry date of the card or network token (where the supplied paymentInstrument was card/wallet+applepay, card/wallet+googlepay, card/networkToken, card/networkToken+applepay or card/networkToken+googlepay).

  - `_embedded.payments.paymentInstrument.card.expiryDate.month` (integer)

  - `_embedded.payments.paymentInstrument.card.expiryDate.year` (integer)

  - `_embedded.payments.paymentInstrument.card.issuerName` (string)
    The name of the card issuer.
    Example: "AN ISSUING BANK LTD"

  - `_embedded.payments.paymentInstrument.card.fundingType` (string)
    How the card is funded.
    Enum: "credit", "debit", "prepaid", "chargeCard", "deferredDebit"

  - `_embedded.payments.paymentInstrument.card.brand` (string)
    The card brand that the transaction was processed with. Sometimes referred to as the network or scheme.
    Example: "visa"

  - `_embedded.payments.paymentInstrument.card.paymentAccountReference` (string)
    The payment account reference (PAR) is a non-financial reference that uniquely identifies the underlying cardholder account. This allows you to correlate payments made from the same account with differing instruments (e.g. card/plain and card/wallet+applepay), where the same account funds the transaction. A PAR cannot be used to initiate a payment.
    Example: "Q1HJZ28RKA1EBL470G9XYG90R5D3E"

  - `_embedded.payments.value` (object)
    An object that contains payment amount and currency.

  - `_embedded.payments.value.amount` (integer, required)
    This is a whole number including the currency exponent (e.g. GBP has an exponent of 2, so for £2.50 supply:250).

  - `_embedded.payments.value.currency` (string, required)
    The 3 digit currency code.

## Response 400 fields (application/vnd.worldpay.payment-queries-v1.hal+json):

  - `errorName` (string, required)
    The type of error.
    Example: "entityIsNotConfigured"

  - `message` (string, required)
    A description of the error
    Example: "Entity is not configured to use this resource"


