# Create a checkout session

## Arguments

| Field               | Type    | Required | Description                                                                                                                                                                                                                                                                               |
| ------------------- | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| amount              | integer | yes      | The amount to be deposit to the customer in the minor currency.                                                                                                                                                                                                                           |
| currency            | string  | yes      | Three-letter ISO currency code (ISO-4217). Must be a supported currency.                                                                                                                                                                                                                  |
| customer\_email     | string  | yes      | Customer’s email.                                                                                                                                                                                                                                                                         |
| customer\_firstname | string  | yes      | Customer’s firstname.                                                                                                                                                                                                                                                                     |
| customer\_lastname  | string  | yes      | Customer’s lastname.                                                                                                                                                                                                                                                                      |
| success\_url        | string  | yes      | The URL to which application should send customers when checkout session is completed.                                                                                                                                                                                                    |
| cancel\_url         | string  | no       | If set, a "Cancel" button will appear during checkout. If the customer cancels the payment, they will be redirected to this cancel\_url                                                                                                                                                   |
| notification\_url   | string  | no       | The webhook URL is the endpoint that receives notifications about events related to the deposit session, such as session creation, status updates, or completion. Check [Checkout Session webhook events specification](/legacy/apm-checkout-blik/webhoook-event-notification.md) section |
| customer\_ip        | string  | no       | Customer’s IP address.                                                                                                                                                                                                                                                                    |
| customer\_country   | string  | no       | Customer’s country.                                                                                                                                                                                                                                                                       |
| payment\_method     | list    | no       | A list of the types of payment methods the Checkout Session is allowed to accept. Possible values: blik                                                                                                                                                                                   |
| expires\_at         | integer | no       | <p>The timestamp indicating when the session will expire. If this parameter is not provided, the default expiration is set to 24 hours after the session is created. Metered in Epoch & Unix Timestamp. expires\_at should not be lower then 2.5 hours.<br></p>                           |
| locale              | string  | no       | The IETF language tag of the locale Checkout is displayed in. If blank, the browser’s locale is used.                                                                                                                                                                                     |
| metadata            | hash    | no       | A set of key-value pairs that you can attach to a payout object. It can be useful for storing additional information about the payout in a structured for                                                                                                                                 |
| customer\_phone     | string  | yes      | Customer phone in E.164 format                                                                                                                                                                                                                                                            |

<mark style="color:yellow;">**`POST`**</mark> `https://{provided url}/v1/checkout/sessions`

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

<pre><code>curl https://{provided url}/v1/checkout/sessions \
  -u sk_test_BQokikJOvBiI2HlWgH4olfQ2: \
  -d amount=1000 \
  -d currency=pln \
<strong>  -d customer_email=john@example.com \
</strong>  -d customer_firstname=John \
  -d customer_lastname=Doe \
  -d payment_method=blik \
  -d expires_at=2147483648
  -d success_url=https://url.com/ \
  -d cancel_url=https://url.com/ \
  -d notification_url:https://url.com/ \
</code></pre>

{% endtab %}
{% endtabs %}

The above command returns JSON structured like this:

```json
{
	"id": "AW-kLcRRC5P8U68CYe0kVA",
	"amount_total": 1000,
	"amount_sub_total": 1000,
	"amount_refunded": 0,
	"currency": "pln",
	"cancel_url": "https://url.com/"
	"customer_firstname": "John",
	"customer_lastname": "Doe",
	"customer_email": "john@example.com",
	"customer_ip": "",
	"customer_country": "",
	"expire_at": 2147483648,
	"created_at": 2147483648,
	"success_url": "https://url.com/",
	"payment_method": ["blik"],
	"locale": "",
	"url": "https://{provided url}/pay/AW-kLcRRC5P8U68CYe0kVA",
	"fees": null,
	"metadata": null,
	"refunds": [],
	"refunded": false,
	"status": "open",
	"livemode": false,
	"notification_url": "https://url.com/"
}
```


---

# 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/apm-checkout-blik/create-a-checkout-session.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.
