# Finix.PaymentForm

Creates a Payment Form instance and renders it into a specified DOM element. Returns a [Form Instance](/js/form-instance) you can use to interact with the form programmatically.


```text
Finix.PaymentForm(element, environment, application, options)
```

| Parameter | Type | Required | Description |
|  --- | --- | --- | --- |
| `element` | `string | HTMLElement` | Yes | DOM target for the form |
| `environment` | `string` | Yes | Finix environment (`sandbox` or `prod`) |
| `application` | `string` | Yes | Your Finix Application ID |
| `options` | `object` | No | Configuration — see [Options](/js/options) |


The DOM location where the payment form renders. Pass either:

- A **string** with the `id` attribute of the target element — class names are not supported
- An **HTMLElement** reference



```html
<div id="payment-form"></div>
```

The Finix environment to connect to. Must match the environment your Application ID belongs to.

| Value | Environment |
|  --- | --- |
| `"sandbox"` | Sandbox |
| `"prod"` | Production |


Your Application ID must belong to the same environment. A sandbox ID used with `"prod"` (or vice versa) will fail.

Your Finix Application ID, assigned when you create your account. Application IDs can exist in both Sandbox and Prod environments — use the one that matches your chosen `environment`.

Pass an `options` object to configure payment methods, address fields, and callbacks. Providing `onSubmit` automatically renders a submit button inside the form.

See [Options](/js/options) for all configuration properties, and [Callbacks](/js/callbacks) for the full callback API.