# Create checkout

> Learn how to collect your customer’s email and shipping address.

## Create checkout page

Merx comes with a [checkout blueprint](https://merx2.wagnerwagner.de/reference/blueprints/pages/checkout.md). Create a new page in the Panel and select *Checkout* as template. By default the status of the page is *unlisted*.

## Create checkout form

Add form fields for the data you need to collect from your customer. In this example we just collect the email address. This would be the place to add fields for name and shipping address.
As the payment gateway we’ll use *invoice* for the moment.

```php title="/site/templates/checkout.php"
…
<form id="checkout-form" action="<?= url('api/shop/checkout') ?>" method="post">
  <label>
    Email
    <input type="email" name="email" autocomplete="email" required>
  </label>
  <input type="hidden" name="payment_gateway" value="invoice">
  <button>Submit order</button>
</form>
…
```

As long as all data is valid, the customer is redirected directly to the order page, where they see the summary of their order.

When there are validation errors (e.g. no email provided) the API endpoint ([`/api/shop/checkout `](https://merx2.wagnerwagner.de/reference/api/routes/shop-checkout-post.md)) returns a JSON with details of the validation error. Continue with **[Validate checkout](https://merx2.wagnerwagner.de/guide/getting-started/validate-checkout.md)** to learn how to define required fields and how to use JavaScript to handle the JSON data.
