# Checkout

## Create a checkout url

<mark style="color:green;">`POST`</mark> `https://plugin.tebex.io/checkout`

Creates a URL which will redirect the player to the webstore and add the package to their basket.

#### Headers

| Name           | Type   | Description                 |
| -------------- | ------ | --------------------------- |
| X-Tebex-Secret | string | The secret key of a server. |

#### Request Body

| Name        | Type   | Description                                         |
| ----------- | ------ | --------------------------------------------------- |
| package\_id | string | The ID of the package the players want to purchase. |
| username    | string | The username of the player.                         |

{% tabs %}
{% tab title="201: Created " %}

```json
{
  "url": "http://example.tebex.io/buy/gj48f",
  "expires": "2015-11-30T18:10:18+0000"
}
```

{% 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://docs.tebex.io/plugin/endpoints/checkout.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.
