---
title: CheckCard Request
slug: checkcard-request
docTags: 
createdAt: 2024-08-19T12:37:01.229Z
---

# Creating a CheckCard Request with the Web SDK

The Web SDK’s Check Card functionality can be used to perform a zero amount pre-authorisation (0 Auth).
Check Card enables you to check the validity of the card, to be used for future payments.

**Do you have a stored card wallet for existing customers?**
If validation is successful, a **card token** is returned as part of the response object.&#x20;
This token can then be stored and used for a `payments` / `preauths` request in the future, using the Web SDK’s [Token Payment](docId\:vOoL6A4NSy9S0gyJpmBst) functionality.

### &#xD;Prerequisites

:::hint{type="info"}
Make sure you are using Web SDK Versio&#x6E;**&#x20;0.0.34** (or higher).
:::

From the **Web SDK integration** guide, you have completed the following:

- [Step One: Create a paymentSession](docId:40dWE6LBub7vdKza1QYDC)
  - You do not need to include the amount or currency fields in your request body.
- [Step Two: Add the Payment Form to your Website](docId:40dWE6LBub7vdKza1QYDC)

***

## Step One: Making a Check Card Request

1. Define the **checkCardConfiguration** object.

:::hint{type="info"}
Ensure the details used when creating the **paymentSession&#x20;**&#x6D;atch the values set in the **checkCardConfiguration&#x20;**&#x6F;bject.
:::

:::CodeblockTabs
Check Card Configuration Object

```javascript
const checkCardConfiguration = {
    judoId: "yourJudoId",
    phoneCountryCode: "44",
    challengeRequestIndicator: "challengeAsMandate",
    initialRecurringPayment: false,
    yourConsumerReference: "yourConsumerReference",
    yourPaymentReference: "yourPaymentReference",
    billingAddress: {
        address1: "My house",
        address2: "My street",
        town: "My town",
        state: "My state", //Mandatory for US and Canada
        postCode: "TR14 8PA",
        country: "826"
    },
    mobileNumber: "07999999999",
    emailAddress: "contact@judopay.com",
}
```
:::

See below for more details on the parameters that create the **checkCardConfiguration&#x20;**&#x6F;bject:

:::hint{type="warning"}
**\*Mastercard Recommends:**
These fields are recommended rather than mandatory. Transactions will continue to be processed if not supplied.&#x20;
See, [Mastercard Recommended 3D Secure 2 Fields](docId\:WpFMF662qaIGEGrpU_Mow).
:::

| **Parameter**                                                                                                       | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `judoId`<br />String<br /><font color="#ef5b2e">Required</font><br /><br />                                         | Unique ID supplied by Judopay.<br />Specific to a merchant and/or location.<br />Format:<br />* 100100100
* Maximum length 9 characters.
* Do not include spaces or dashes.                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `yourConsumerReference`<br />String<br /><font color="#ef5b2e">Required</font><br />                                | Unique reference to anonymously identify your customer.<br />Advisable to use GUIDs.<br />Must be below 40 characters.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `yourPaymentReference`<br />String<br /><font color="#ef5b2e">Required</font><br />                                 | Your unique reference for this payment.<br />Format:<br />* Maximum length 50 characters.<br />This value should be unique in order to protect your customers against duplicate transactions. <br />With a server side integration, if a payment reference is not supplied, the transaction will not be processed.                                                                                                                                                                                                                                                                                                                      |
| `phoneCountryCode`<br />String<br /><font color="#ef5b2e">Recommended</font> <font color="#ef5b2e">*</font><br />   | The country code of the consumer's phone.<br />Format:<br />* Maximum length 3 characters.
* Only numbers allowed.
* Do not include special characters or spaces.<br />Must be set if **mobileNumber** is set.<br />If not set, default = 44                                                                                                                                                                                                                                                                                                                                                                                            |
| `mobileNumber`<br />String<br /><font color="#ef5b2e">Recommended</font> <font color="#ef5b2e">*</font><br /><br /> | Consumer’s valid mobile number.<br /><br />Mastercard recommends providing at least **one contact method** for Mastercard 3D Secure authenticated transactions.<br />Format:<br />* Maximum length 15 characters.
* Only numbers allowed.
* Do not include special characters or spaces.<br />Must be set if **phoneCountryCode** is set.                                                                                                                                                                                                                                                                                               |
| `cardHolderName`<br />String<br /><font color="#ef5b2e">Recommended</font> <font color="#ef5b2e">*</font><br />     | The card name of the consumer<br />If the cardHolderName field is displayed to the user in the payment form (**isCardHolderNameVisible: true&#x20;**&#x69;s set in the iFrame config), the value entered in the payment form will overwrite this value.                                                                                                                                                                                                                                                                                                                                                                                 |
| `challengeRequestIndicator`<br />String<br /><font color="#42cbd4">Optional</font><br /><br />                      | Indicates the type of challenge request you wish to apply.<br />Set this to one of the following strings:<br />* `noPreference`
* `noChallenge`
  - No challenge required.
* `challengePreferred`
  - A challenge is preferred for this transaction.
* `challengeAsMandate`
  - Must challenge this transaction.<br />This **should not&#x20;**&#x62;e included in the same configuration object as **scaExemption**.                                                                                                                                                                                                                   |
| `scaExemption`<br />String<br /><font color="#42cbd4">Optional</font><br /><br />                                   | To apply for an exemption from SCA, for a customer initiated transaction.<br />Set this to one of the following strings:<br />* `lowValue`
  - Transactions up to €45 do not require SCA, up to a maximum of five consecutive transactions, or a cumulative limit of €100.
* `trustedBeneficiary`
  - Provides the cardholder the option to add the merchant to their trusted list.
* `transactionRiskAnalysis`
  - Allows for certain remote transactions to be exempt from SCA, provided a robust risk analysis is performed.<br />This **should not** be included in the same configuration object as **challengeRequestIndicator**. |
| `initialRecurringPayment`<br />Boolean<br /><font color="#42cbd4">Optional</font>                                   | Indicates if this initial payment is part of a recurring payment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `billingAddress`<br />Object<br /><font color="#42cbd4">Optional</font><br /><br />                                 | Card holder's billing address.<br />Properties:<br />* `address1` <font color="#ef5b2e">(</font><font color="#ef5b2e">Recommended)</font><font color="#ef5b2e">*</font>
* `address2` (optional)
* `town`
* `state`(only required if country is USA/Canada)
  - Format:
    - string
    - ISO Alpha-2 Code (e.g. California = "**CA**")
* `country`
  - Format:
    - string
    - See [here](docId\:XZE369mFK5UVOSaNzM8UO) for the list of valid **ISO 3166-1** format country codes.
* `postCode`<br />If the billingAddress is provided, the postcode is **required**.                                                               |
| `emailAddress`<br />String<br /><font color="#ef5b2e">Recommended</font> <font color="#ef5b2e">*</font>             | Consumer’s valid email address.<br /><br />Mastercard recommends providing at least **one contact method** for Mastercard 3D Secure authenticated transactions.                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |

2\. In a function, add th&#x65;**&#x20;invokeCheckCard** call.
This will make Check Card request using both the **paymentSession&#x20;**&#x61;nd **checkCardConfiguration**.

:::CodeblockTabs
Invoke Check Card Call

```json
function handleCheckCardButtonClick() {
    judo.invokeCheckCard(paymentSession, checkCardConfiguration)
    .then(handleSuccess)
    .catch(handleError)
}
```
:::

3\. To call the invokeCheckCard function (in step 2 above) to make the Check Card request, add the **onclick&#x20;**&#x61;ttribute to the payment button \<div>:
`<button id="submit-payment-button" onclick="handleCheckCardButtonClick()"> Check Card </button>`

:::hint{type="info"}
This is the same button that is used for payments, however you can update the button label to reflect it’s functionality.&#x20;
For example: **Check Card** instead of **Pay Now**.
:::

***

## Step Two: Handle the Response

All the Judopay Web SDK transaction methods return a promise.
Once the authorisation is complete, the promise will be either fulfilled or rejected.

**Fulfilled**

- You will receive a JSON object response (a Judopay receipt object).
  - For more information and schema on the JSON object, see [API Transaction Response](docId\:bcXNM5keOk-nlNrZTafUT).
- Depending on the result the consumer should be redirected to the appropriate outcome page.
  - For example, if the result = SUCCESS redirect the consumer to the Success Page.
- This page should display the necessary transaction information (found in the Judopay receipt object).

**Rejected**

- You will receive an error object
  - For more information on error responses returned, see [Web SDK Error Responses](docId\:qfxaWPAQl_-2EVfP8y94d).
- The consumer should be redirected to an Error Page.

:::CodeblockTabs
Response Example

```json
const onFulfillment = (receiptObject) => {
  const { result } = receiptObject
  //redirect to appropriate page depending on the result (success/failure/declined page)
}

const onRejection = (error) => {
  //redirect to error page and handle error
}
```
:::

For more information on the response codes, see [Codes](docId:_zrsihomUEW-XnRQ4PBtJ).

