# Create a hosted payment page

`POST /v3/hosted-page`

Section: Hosted Page. Base URLs: Playground https://playground-api.briqpay.com, Production https://api.briqpay.com. Auth: HTTP Basic.

Create a hosted payment page. This requires you to first [create a session](https://developer.briqpay.com/api-reference/create-session.md), and then with the help of the sessionId from that call, create a hosted page for it.

## Headers

- `Accept` (string, one of: `"application/json"`)
- `Authorization` (string): Format: "Basic <base64(username:secret)>"

## Request body

- `sessionId` (string, required): **Format:** UUID. The sessionId is retrieved from **data.sessionId** on a previously created session.
- `config` (object)
  - `pageTitle` (string, min length 3, max length 256): A short text of information to display to the end-user beneath the logo.
  - `logoUrl` (string, max length 512): URL to an image: png | jpg | jpeg | svg
  - `showCart` (boolean, default `true`): Whether to display the cart items above the payment section or not.

## Request example

```bash
curl -X POST 'https://playground-api.briqpay.com/v3/hosted-page' \
  -H 'Authorization: Basic <base64(merchantId:secret)>' \
  -H 'Content-Type: application/json'
```

No request body example in the spec yet.

## Responses

### 200

- `hostedPageId` (string): **Format:** UUID.
- `sessionId` (string): **Format:** UUID. The sessionId is retrieved from **data.sessionId** on a previously created session.
- `url` (string): URL to the newly created Hosted Page.
- `config` (object)
  - `pageTitle` (string, min length 3, max length 256): A short text of information to display to the end-user beneath the logo.
  - `logoUrl` (string, max length 512): URL to an image: png | jpg | jpeg | svg
  - `showCart` (boolean, default `true`): Whether to display the cart items above the payment section or not.

### 400

- `error` (object)
  - `code` (string, one of: `"INVALID_CREDENTIALS"`, `"INVALID_DATA"`, `"UNKNOWN"`)
  - `message` (string)

### 403

- `error` (object)
  - `code` (string, one of: `"INVALID_CREDENTIALS"`, `"INVALID_API_KEY"`, `"AUTH_SECRET_EXPIRED"`)
  - `message` (string)

### 404

- `error` (object)
  - `code` (string, one of: `"SESSION_NOT_FOUND"`)
  - `message` (string)
