# Options

## **key `string`** **`required`**

Merchant public key.

## **host `string`** **`required`**

Checkout server baseUrl.

## **type `string`** **`optional`**

Whether you to create a bank account or card token.

Only accepts `bank_account` or `card` values. Set to `card` by default.

## **theme `string`** **`optional`**

Specify the preferred ui appearance for the **Checkout** form.

Supported themes are `light` and `dark`.

Set to `light` by default.

## **locale `string`** **`optional`**

Specify the preferred language for the **Checkout** form.

Supported languages are `en` and `es`.

Set to current locale system from user web browser by default if is supported, otherwise fallback to `en`.

## **defaultCountry `string`** **`optional`**

Default value for country field id **allowBilling** is `true`. Set to `US` by default.

## **defaultCurrency `string`** **`optional`**

Default value for currency field if **allowCurrency** is `true`. Set to `USD` by default.

## **allowBilling `string`** **`optional`**

Whether to allow or not billing information. Set to `true` by default.

## **allowCurrency `string`** **`optional`**

Whether to allow or not currency field. Set to `true` by default.

## **onLoaded `function`** **`optional`**

Callback triggered when checkout is fully and successfully loaded.

## **onCreated(token `object`) `function`** **`optional`**

Callback triggered when checkout has successfully created a token.

## **onCanceled `function`** **`optional`**

Callback triggered when checkout is canceled by user.

## **onError(error `object`) `function`** **`optional`**

Callback triggered when checkout throws an error.

{% tabs %}
{% tab title="JS" %}

```javascript
var checkout = new Checkout(
    host: "https://checkout3.gpnpay.com",
    key: "pk_test_qhDUMhE0-lzH4PtK0nDvPQ",
    type: "card",
    theme: "dark",
    locale: "es",
    allowBilling: true,
    allowCurrency: true,
    defaultCountry: "US", // United States
    defaultCurrency: "USD", // United States Dollar

    onLoaded: function () {
        // checkout loaded.
    },

    onCreated: function (token) {
        // token created.
    },

    onCanceled: function () {
        // user canceled
    },

    onError: function (error) {
        // error has occurred
    },
);
```

{% endtab %}

{% tab title="DART" %}

```dart
final checkout =  Checkout(
    host: 'https://checkout3.gpnpay.com',
    key: 'pk_test_qhDUMhE0-lzH4PtK0nDvPQ',
    type: TokenType.card,
    theme: 'dark',
    locale: 'es',
    allowBilling: true,
    allowCurrency: true,
    defaultCountry: 'US', // United States
    defaultCurrency: 'USD', // United States Dollar

    onLoaded: () {
        // checkout loaded.
    },

    onCreated: (PaymentToken token) {
        // token created.
    },

    onCanceled: () {
        // user canceled
    },

    onError: (Object error) {
        // error has occurred
    },
);
```

{% endtab %}

{% tab title="ANGULAR" %}

```
<checkout
    host="https://checkout3.gpnpay.com"
    key="pk_test_qhDUMhE0-lzH4PtK0nDvPQ"
    [type]="TokenType.card",
    theme="dark",
    locale="es",
    defaultCountry="US"
    defaultCurrency="USD"
    allowBilling
    allowCurrency
    (loaded)="handleLoad()"
    (created)="handleCreate($event)"
    (canceled)="handleCanceled()"
    (error)="handleError($event)"
></checkout>
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.convergegate.com/legacy/checkout-v3/introduction/options.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
