# Visa Click to Pay

## Merchants and Payment Service Providers

## First Steps

### Before You Start

Let’s quickly learn how to make a call to a Visa Click to Pay API but before making your first API call, ensure you have:

- Onboarded by creating an account and opened a Click to Pay Project. (See [Onboarding Guide](https://developer.visa.com/capabilities/visa-secure-remote-commerce/tutorials-and-guides))
- Valid sandbox credentials (API key and x-pay-token). (See [how to get your credentials](https://developer.visa.com/capabilities/visa-secure-remote-commerce/api-fundamentals))
- You have a SRC Client ID and DPA ID

This guide walks you through your first REST API call (Identity Lookup). When you progress to implementing Checkout, you will also need an `initializationSessionId` obtained from **Initialise SRC** — a browser-based initialization step that runs on your checkout page ahead of any Checkout API call. See [Initialize SRC](https://developer.visa.com/capabilities/visa-secure-remote-commerce/introduction-to-visa-click-to-pay-api#section0) to plan this alongside your REST integration.

### Calling Your First API

We will first connect to the [**Identity Lookup**](https://developer.visa.com/capabilities/visa-secure-remote-commerce/introduction-to-visa-click-to-pay-api#section2) endpoint so that you can check if a Click to Pay profile exists. This endpoint determines whether `consumerIdentity` (email or mobile number) is associated with a Visa Click to Pay profile in the SRC system.

You can try calling this API using your API Client (e.g. Postman) or implement it directly in your code.

**1. Set up your request's authentication header**

Include the required X-Pay Token:

```
x-pay-token: [YOUR_XPAYTOKEN]
```

**2. Set the header's Content Type**

Add Content Type as a JSON object:

```
Content-Type: application/json
```

**3. Configure the request URL**

Use the sandbox Identity Lookup endpoint with your API key:

```
POST https://sandbox.api.visa.com/src/v1/identities/lookup?apikey=<YOUR_API_KEY>
```

**4. Prepare the request body**

Create a JSON request body with the required fields. Use your API key as the srcClientId value, and the email provided in our test data (available in the **Asset** section in your VDC Project) to get a valid response.

```json

```

**5. Send the request**

Make the POST request to the API endpoint with all headers and body configured.

**6. Verify response**

Check for a successful response with status code 200. The response body should contain:

```json

```

**A successful response indicates:**

- Your authentication is working correctly
- Your API integration is properly configured
- You are ready to proceed with more complex API operations

The `consumerPresent1` field indicates whether the provided email address or mobile phone number is present in the SRC profile.

After your first successful API call:

- Test error scenarios with invalid data
- Explore other API endpoints
- Before testing Checkout, implement Initialize SRC on your checkout page to obtain an `initializationSessionId`; Checkout requires this identifier for device profiling and VPP authentication. See [Initialize SRC](https://developer.visa.com/capabilities/visa-secure-remote-commerce/introduction-to-visa-click-to-pay-api#section0)
- Implement proper error handling in your application
- Review the API response structure for integration planning

#### Next Steps

See [Introduction to the Visa Click to Pay API](https://developer.visa.com/capabilities/visa-secure-remote-commerce/introduction-to-visa-click-to-pay-api) to view the other endpoints in the Visa Click to Pay API.

Before building your Checkout flow, read [Initialize SRC](https://developer.visa.com/capabilities/visa-secure-remote-commerce/introduction-to-visa-click-to-pay-api#section0)(the browser-based initialization step required before Checkout is called).
