# Decrypt a Google Pay payment token

Decrypts an encrypted Google Pay payment token. This endpoint allows you to process Google Pay wallet tokens on your backend, extracting the necessary payment and authentication data required for transaction authorisation. The decryption process validates the token integrity and returns structured payment information.

Endpoint: POST /wallets/GooglePay/decrypt-token
Version: 1.0.0

## Request fields (application/json):

  - `token` (string, required)
    The encrypted payment token provided by the wallet provider (Apple Pay or Google Pay). This token contains the encrypted payment data that needs to be decrypted to process the transaction.
    Example: "encrypted-token-string-here"

  - `site` (string, required)
    Your unique site identifier, as assigned by PXP. This value is used to validate the decryption request against your configuration.
    Example: "SITE-1"

## Response 200 fields (application/json):

  - `body` (object) — one of:
    - Google Pay (DPAN):
      - `gatewayMerchantId` (string,null)
        The merchant identifier as configured in the Google Pay gateway. This value is retrieved from the Unity session.
        Example: "getFromUnitySession"
      - `messageExpiration` (string,null)
        The expiration timestamp for the decrypted message in milliseconds since Unix epoch. After this time, the decrypted data should not be used.
        Example: "1761028346476"
      - `messageId` (string,null)
        A unique identifier for the payment message, used for tracking and debugging purposes.
        Example: "AH2EjtdTFaP1MbWiWkIW4c1s594s5XelUTFVViOjj3X_Gs8GQCLiTXc-bnqvlKHe8TntL6yyaV-I5digQgbvrRxxjBv7il60Ll70k6nwyhGYUvyoGxcsLFo"
      - `paymentMethod` (string,null)
        The payment method type used for the transaction.
        Enum: "CARD", "TOKENIZED_CARD"
      - `paymentMethodDetails` (object,null)
        Details about the payment method, including card details and authentication status.
      - `paymentMethodDetails.expirationYear` (integer,null)
        The card's expiry year.
        Example: 2030
      - `paymentMethodDetails.expirationMonth` (integer,null)
        The card's expiry month.
        Example: 12
      - `paymentMethodDetails.pan` (string,null)
        The Device Primary Account Number (DPAN) - a tokenized card number specific to this device. This is different from the actual card PAN.
        Example: "4713747730076631"
      - `paymentMethodDetails.authMethod` (string,null)
        The authentication method used for the transaction.
        Enum: "PAN_ONLY", "CRYPTOGRAM_3DS"
      - `paymentMethodDetails.cryptogram` (string,null)
        The 3D Secure cryptogram for authenticated transactions. Only present when authMethod is CRYPTOGRAM_3DS.
        Example: "AgAAAAAABk4DWZ4C28yUQAAAAAA="
      - `paymentMethodDetails.eciIndicator` (string,null)
        The Electronic Commerce Indicator for 3D Secure transactions. Only present when authMethod is CRYPTOGRAM_3DS.
        Example: "07"
      - `paymentMethodDetails.assuranceDetails` (object,null)
        Details about the level of assurance provided by Google Pay for this transaction.
      - `paymentMethodDetails.assuranceDetails.cardHolderAuthenticated` (boolean,null)
        Whether the cardholder was authenticated using their device credentials (biometric, PIN, or pattern).
      - `paymentMethodDetails.assuranceDetails.accountVerified` (boolean,null)
        Whether the card account was verified by the issuing bank when added to Google Pay.
        Example: true
    - Google Pay (FPAN):
      - `gatewayMerchantId` (string,null)
        The merchant identifier as configured in the Google Pay gateway. This value is retrieved from the Unity session.
        Example: "getFromUnitySession"
      - `messageExpiration` (string,null)
        The expiration timestamp for the decrypted message in milliseconds since Unix epoch. After this time, the decrypted data should not be used.
        Example: "1761027987591"
      - `messageId` (string,null)
        A unique identifier for the payment message, used for tracking and debugging purposes.
        Example: "AH2EjtdR_Fe2nseX21CbUY93yi6cY33QEsiSPHa7-K6pQXxO9O37AdGwVAI0p53p54GLukiZU2wEJrxfQUUP6KH1yXIf0ejuEtjMLeSbYhTQh7zhOLrzeQg"
      - `paymentMethod` (string,null)
        The payment method type used for the transaction.
        Enum: same as `paymentMethod` in "Google Pay (DPAN)" (2 values)
      - `paymentMethodDetails` (object,null)
        Details about the payment method, including card details and authentication status.
      - `paymentMethodDetails.expirationYear` (integer,null)
        The card's expiry year.
        Example: 2030
      - `paymentMethodDetails.expirationMonth` (integer,null)
        The card's expiry month.
        Example: 12
      - `paymentMethodDetails.pan` (string,null)
        The Funding Primary Account Number (FPAN). This is the actual card number on file with the card issuer. This should be handled with appropriate PCI DSS security measures.
        Example: "4012002436599751"
      - `paymentMethodDetails.authMethod` (string,null)
        The authentication method used for the transaction.
        Enum: same as `paymentMethodDetails.authMethod` in "Google Pay (DPAN)" (2 values)
      - `paymentMethodDetails.cryptogram` (string,null)
        The 3D Secure cryptogram for authenticated transactions. Only present when authMethod is CRYPTOGRAM_3DS.
        Example: "AgAAAAAABk4DWZ4C28yUQAAAAAA="
      - `paymentMethodDetails.eciIndicator` (string,null)
        The Electronic Commerce Indicator for 3D Secure transactions. Only present when authMethod is CRYPTOGRAM_3DS.
        Example: "07"
      - `paymentMethodDetails.assuranceDetails` (object,null)
        Details about the level of assurance provided by Google Pay for this transaction.
      - `paymentMethodDetails.assuranceDetails.cardHolderAuthenticated` (boolean,null)
        Whether the cardholder was authenticated using their device credentials (biometric, PIN, or pattern).
      - `paymentMethodDetails.assuranceDetails.accountVerified` (boolean,null)
        Whether the card account was verified by the issuing bank when added to Google Pay.
        Example: true

## Response 400 fields (application/json):

  - `correlationId` (string, required)
    A unique identifier for tracking the request through the system.
    Example: "81f32b80-2ba0-4430-8ecd-0b559274ba9c"

  - `details` (array)
    Additional details about the error.

  - `errorCode` (string, required)
    A specific error code identifying the type of error.
    Example: "WALLET0001"

  - `errorReason` (string, required)
    A human-readable description of the error.
    Example: "Invalid encrypted token format"

## Response 401 fields (application/json):

  - `correlationId` (string, required)
    A unique identifier for tracking the request through the system.
    Example: "81f32b80-2ba0-4430-8ecd-0b559274ba9c"

  - `details` (array)
    Additional details about the error.

  - `errorCode` (string, required)
    A specific error code identifying the type of error.
    Example: "WALLET0002"

  - `errorReason` (string, required)
    A human-readable description of the error.
    Example: "Authentication failed"

## Response 403 fields (application/json):

  - `correlationId` (string, required)
    A unique identifier for tracking the request through the system.
    Example: "81f32b80-2ba0-4430-8ecd-0b559274ba9c"

  - `details` (array)
    Additional details about the error.

  - `errorCode` (string, required)
    A specific error code identifying the type of error.
    Example: "WALLET0003"

  - `errorReason` (string, required)
    A human-readable description of the error.
    Example: "Site not authorised for wallet decryption."

## Response 404 fields (application/json):

  - `correlationId` (string, required)
    A unique identifier for tracking the request through the system.
    Example: "81f32b80-2ba0-4430-8ecd-0b559274ba9c"

  - `details` (array)
    Additional details about the error.

  - `errorCode` (string, required)
    A specific error code identifying the type of error.
    Example: "WALLET0004"

  - `errorReason` (string, required)
    A human-readable description of the error.
    Example: "Site configuration not found"

## Response 500 fields (application/json):

  - `correlationId` (string, required)
    A unique identifier for tracking the request through the system.
    Example: "81f32b80-2ba0-4430-8ecd-0b559274ba9c"

  - `details` (array)
    Additional details about the error.

  - `errorCode` (string, required)
    A specific error code identifying the type of error.
    Example: "WALLET0005"

  - `errorReason` (string, required)
    A human-readable description of the error.
    Example: "Decryption service unavailable"


