---
title: "Prefilling Application Data"
description: "Learn how to provide customer data to pre-populate the Embedded Journey application form"
url: "https://docs.wayflyer.com/embedded-journey-v5-overview/prefilling-application-data"
image: "https://docs.wayflyer.com/_og/d/c_Ocean.takumi,title_Prefilling+Application+Data,description_Learn+how+to+provide+customer+data+to+pre-populate+the+Embedded+Journey+application+form,props_eyJ0aGVtZSI6eyJtb2RlIjoibGlnaHQiLCJjb2xvcnMiOnsicHJpbWFyeSI6IiMyMzIzMmQifX19,p_Ii9lbWJlZGRlZC1qb3VybmV5LXY1LW92ZXJ2aWV3L3ByZWZpbGxpbmctYXBwbGljYXRpb24tZGF0YSI,s_P5eQ09HcTRZK39uM.png"
---

## Prefilling Application Data

Reduce friction for your users by providing data you already have to pre-populate the Embedded Journey application form.

## [Overview](#overview)

Partners typically already hold data about their customers — email addresses, company names, country of incorporation, and more. The Embedded Journey allows partners to pass this data via a **prefill callback**, so users do not have to re-enter information you already have.

Prefilling data:

-   **Reduces friction** — users skip fields that are already populated, completing the journey faster.
-   **Improves data accuracy** — data sourced from the partner's system is less likely to contain errors.
-   **Increases conversion** — fewer steps to complete means lower drop-off rates.

## [How it works](#how-it-works)

When the user opens the Embedded Journey panel, the SDK invokes a callback function provided by the partner. This callback can return an `EmbeddedJourneyPrefill` object containing any known data. The SDK uses this data to pre-populate the corresponding fields in the application form.

The callback is:

-   **Asynchronous** — you can fetch data from your backend before returning.
-   **Optional** — returning `void` is valid if no data is available.
-   **Called on panel open** — it runs each time the user opens the journey panel, so it always has the latest data.

## [UI SDK integration](#ui-sdk-integration)

Pass the prefill callback as the second argument to `mountCta`:

```typescript
import {
  WayflyerUiSdk,
  type EmbeddedJourneyPrefillCallback,
  type EmbeddedJourneyPrefill,
} from '@wf-financing/ui-sdk';

const wayflyerUiSdk = await WayflyerUiSdk.loadSdk(companyToken);

const prefillCallback: EmbeddedJourneyPrefillCallback = async () => {
  const prefill: EmbeddedJourneyPrefill = {
    email: 'merchant@example.com',
    companyName: 'Acme Ltd',
    country: 'IE',
    monthlyRevenue: 50000,
    primaryStoreUrl: 'https://acme.com',
  };

  return prefill;
};

wayflyerUiSdk.mountCta('wayflyer-cta', prefillCallback);
```

## [Fetching data asynchronously](#fetching-data-asynchronously)

The callback supports asynchronous operations. You can fetch data from your backend before returning:

```typescript
const prefillCallback: EmbeddedJourneyPrefillCallback = async () => {
  const customerData = await fetch('/api/current-customer');
  const data = await customerData.json();

  return {
    email: data.email,
    companyName: data.businessName,
    country: data.countryCode,
    monthlyRevenue: data.revenue,
  };
};
```

## [Available prefill fields](#available-prefill-fields)

All fields are optional. Provide whichever fields you have available.

| Field               | Type                                   | Description                                                                      | Example                                       |
| :------------------ | :------------------------------------- | :------------------------------------------------------------------------------- | :-------------------------------------------- |
| email               | string                                 | User's email address                                                             | "merchant@example.com"                        |
| phoneNumber         | { number: string, regionCode: string } | User's phone number with region code                                             | { number: "+353861234567", regionCode: "IE" } |
| country             | string                                 | ISO 3166-1 alpha-2 country code                                                  | "IE"                                          |
| stateOrProvince     | string                                 | ISO 3166-2 state/province code. Only required for US and Canada.                 | "US-CA"                                       |
| monthlyRevenue      | number                                 | Average monthly revenue over the last 6 months, in the company's local currency. If an exact figure is not available, an approximation is fine. | 50000                                         |
| companyName         | string                                 | Business name                                                                    | "Acme Ltd"                                    |
| primaryStoreUrl     | string                                 | Primary website or online store URL                                              | "https://acme.com"                            |
| dateOfIncorporation | string                                 | Date the business was incorporated                                               | "2020-01-15"                                  |

## [Behaviour](#behaviour)

-   Prefilled fields are shown to the user as pre-populated but **editable** — users can change any prefilled value.
-   If the user already has saved progress on an in-progress application, the saved progress takes precedence over prefilled data.
-   Fields that are not provided in the prefill object are left blank for the user to complete.

## [Headless SDK](#headless-sdk)

The prefill callback is a UI SDK concept. If you are using the Headless SDK to build your own UI, you already have full control over the data you pass to `updateUserDetails()` and `updateCompanyDetails()` — you can pre-populate your own form fields directly from your data sources.