# Prefill Customer Details

Source: https://docs.gocardless.com/docs/optimise/prefill-customer-details

# Prefilling customer details

If you already hold information about your customer (the payer), you can provide this information before sending your customer through a Billing Request Flow. As a result of prefilling customer data, the customer will need to perform fewer steps to complete their payment flow. This leads to a more seamless experience with less friction for the customer and will result in higher conversion.

There are three ways that prefilling can be done.

1. **[Collect Customer Details](/docs/collect-payments/setting-up-mandates) endpoint** — Creates a fully pre-populated customer record so the customer skips the details page. Requires [GoCardless Pro](https://gocardless.com/pricing) or [GoCardless Enterprise](https://gocardless.com/pricing) with the [custom payment pages upgrade](https://support.gocardless.com/hc/en-gb/articles/115003734705-Custom-payment-pages).
2. **Existing customer record** — Link an existing customer ID to the Billing Request. The customer's details are already known and they skip the customer details page entirely.
3. **Billing Request Flows API** — Pass prefilled values into the Billing Request Flow. The customer sees their details pre-populated in the form and only needs to confirm them.

This flowchart explains which of the above methods you would use for various situations:

![Billing Request Prefilling workflow choices](/images/docs/optimise/prefill-customer-details/br_prefilling_choices.png)

This doc explains how to prefill customer details using each of these approaches before sending someone into a Billing Request Flow.

> **Info:**
> When customer details are captured on a billing request, GoCardless automatically shows an email
>   verification prompt when the authorisation link is opened. [See how Customer Email Check
>   works.](/docs/optimise/prefill-customer-details/customer-email-check)

## Create a Billing Request

Create a Billing Request for whatever resources you want to create - our example will ask for a payment of £5. Omitting a customer ID means we'll create a new, blank customer linked against the request.

Use the [Create a Billing Request](/docs/api-reference/billing-request#create-a-billing-request) endpoint:

```json
POST /billing_requests

  }
}
```

You will receive a full Billing Request, and the new customer and customer billing details will be linked against it.

It will look like this:

```json
,
    "links": 
  }
}
```

## Provide details you wish to prefill

If we know our customer's name is Paddington Bear, we can provide those details via the [Collect Customer Details](/docs/collect-payments/integration-planner) endpoint.

Using the ID of the Billing Request we just created:

```json
POST /billing_requests/BRQ123/actions/collect_customer_details
,
    "customer_billing_detail": 
  }
}
```

This returns the Billing Request:

```json
,
      "metadata": 
    },
    "links": ,
    "actions": [
      
        }
      },
      ...,
    ],
    "resources": 
      },
      "customer_billing_detail": 
    }
  }
}
```

Note that the embedded customer resource contains the prefilled customer details that have been provided. Also note that the `collect_customer_details` action is in the `completed` state.

## Create a Billing Request Flow

Create a Billing Request Flow to retrieve a link that can be provided to your customer to complete the request:

```json
POST /billing_request_flows

  }
}
```

This returns the Billing Request Flow:

```json

  }
}
```

If the customer visits the `authorisation_url`, they will will be taken directly to the bank select stage thus skipping the collect customer details step since this has been completed for them already.

## Final note

It's worth noting that this same functionality means customers who leave the flow and come back later will resume from where they left off.

## What's next?

  
#### [Prefill with Existing Customer](/docs/optimise/prefill-customer-details/existing-customers)

Link an existing customer record to skip the customer details step entirely.

  
#### [Prefill into Billing Request Flow](/docs/optimise/prefill-customer-details/billing-request-flow)

Pass prefilled values directly into the checkout flow.