# Get DCC rate

Retrieve the Dynamic Currency Conversion (DCC) rate for a transaction from various providers.

Endpoint: POST /dcc/rate
Version: 1.0.0

## Request fields (application/json):

  - `merchant` (string, required)
    Your unique merchant identifier, as assigned by PXP.
    Example: MERCHANT-1

  - `site` (string, required)
    Your unique site identifier, as assigned by PXP.
    Example: SITE-1

  - `exchangeRateProvider` (string, required)
    The exchange rate provider to use for the DCC rate calculation.
    Enum: "Elavon", "Fexco"

  - `securityLevel` (object, required)
    Details about the security level of the transaction.

  - `securityLevel.primaryAccountNumber` (string, required)
    The primary account number.
    Example: {primaryAccountNumber}

  - `transactionMethod` (object, required)
    Details about the transaction method.

  - `transactionMethod.entryMode` (string, required)
    The entry mode of the transaction.
    Enum: "Instore", "Ecom"

  - `transactionMethod.intent` (string, required)
    The intent of the transaction.
    Enum: "Purchase", "Authorisation", "EstimatedAuthorisation", "Capture", "FinalCapture", "Refund", "Reversal"

  - `pointOfInteraction` (object)
    Details about the point of interaction. This object is optional for `Ecom` transactions.

  - `pointOfInteraction.entryType` (string)
    The type of entry used to capture the card details.
    Enum: "CardContactless", "ChipAndPin"

  - `pointOfInteraction.merchantPointOfSaleId` (string)
    The unique identifier for the merchant point of sale.
    Example: POS-001

  - `amounts` (object, required)

  - `amounts.localCurrencyCode` (string, required)
    Currency code in ISO 4217 format.
    Example: USD

  - `amounts.localTransaction` (number, required)
    The transaction amount in the local currency.
    Example: 100

## Response 200 fields (application/json):

  - `state` (string, required)
    The state of the DCC rate request.
    Enum: "Available", "NotAvailable", "CardEligible", "CardNotEligible", "Error"

  - `amounts` (object, required)
    Details about the amounts.

  - `amounts.local` (object, required)

  - `amounts.local.transaction` (number, required)
    The transaction amount in the local currency.
    Example: 100

  - `amounts.local.currencyCode` (string, required)
    Currency code in ISO 4217 format.
    Example: USD

  - `amounts.cardholder` (object, required)

  - `amounts.cardholder.transaction` (number, required)
    The transaction amount in the cardholder's currency.
    Example: 85.5

  - `exchangeRate` (object, required)
    Details about the exchange rate.

  - `exchangeRate.rate` (number, required)
    The foreign exchange rate.
    Example: 0.855

  - `exchangeRate.exponent` (integer, required)
    The exponent of the foreign exchange rate.
    Example: 3

  - `exchangeRate.markUpPercentage` (number, required)
    The markup percentage.
    Example: 3

  - `exchangeRate.commissionRate` (number, required)
    The commission rate applied.
    Example: 0.025

  - `exchangeRate.margin` (number, required)
    The margin applied.
    Example: 2.1

  - `messaging` (object, required)
    Details about the messaging of the DCC rate request.

  - `messaging.markUpMessage` (string, required)
    Message about the markup.
    Example: Competitive exchange rate with 3.5% markup

  - `messaging.disclaimer` (string, required)
    Disclaimer text about the rate.
    Example: Exchange rate includes markup and may vary.

  - `providerResponse` (any, required)

  - `providerResponse.provider` (string, required)
    The name of the provider.
    Example: Elavon

  - `providerResponse.referenceId` (string, required)
    The Elavon reference ID.
    Example: REF123456789

  - `providerResponse.terminalId` (string, required)
    The terminal ID provided by Elavon.
    Example: TERM001

  - `providerResponse.referenceId` (string, required)
    The reference ID provided by Fexco.
    Example: FX987654321

  - `providerResponse.terminalId` (string, required)
    The terminal ID provided by Fexco.
    Example: TERM001

## Response 400 fields (application/json):

  - `error` (string, required)
    The error code.
    Example: VALIDATION_ERROR

  - `message` (string, required)
    The error message.
    Example: Either encryptedPayload or primaryAccountNumber must be provided in securityLevel

  - `details` (string)
    Additional details about the error.
    Example: List [ "Field 'merchant' is required", "Field 'localTransaction' must be greater than 0" ]

## Response 401 fields (application/json):

  - `error` (string, required)
    The error code.
    Example: VALIDATION_ERROR

  - `message` (string, required)
    The error message.
    Example: Either encryptedPayload or primaryAccountNumber must be provided in securityLevel

  - `details` (string)
    Additional details about the error.
    Example: List [ "Field 'merchant' is required", "Field 'localTransaction' must be greater than 0" ]

## Response 500 fields (application/json):

  - `error` (string, required)
    The error code.
    Example: VALIDATION_ERROR

  - `message` (string, required)
    The error message.
    Example: Either encryptedPayload or primaryAccountNumber must be provided in securityLevel

  - `details` (string)
    Additional details about the error.
    Example: List [ "Field 'merchant' is required", "Field 'localTransaction' must be greater than 0" ]

