> For the complete documentation index, see [llms.txt](https://docs.optty.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.optty.com/hosted-payment-page/optty-direct-sessions/creating-a-session.md).

# Creating a Session

## POST /custom/hpp

> Create custom payment link ---- \[auth scope:  merchant]

```json
{"openapi":"3.0.0","info":{"title":"Merchant API","version":"1.0"},"paths":{"/custom/hpp":{"post":{"operationId":"CustomHppController_createCustomHpp","summary":"Create custom payment link ---- [auth scope:  merchant]","deprecated":false,"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomHppDto"}}}},"responses":{"200":{"description":"Get Paid link created successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomPaymentLinkResponse"}}}}},"tags":["custom"]}}},"components":{"schemas":{"CustomHppDto":{"type":"object","properties":{"email":{"type":"string","description":"Hpp user email."},"price":{"type":"number","description":"Hpp payment price"},"phoneNumber":{"type":"string","description":"Hpp user phone number"},"description":{"type":"string","description":"Hpp payment description"},"currency":{"type":"string","description":"Hpp payment currency"},"accountCode":{"type":"string","description":"Hpp payment accountCode"},"invoiceNumber":{"type":"string","description":"Hpp payment invoiceNumber"},"referenceName":{"type":"string","description":"Hpp payment referenceName"},"dueDate":{"format":"date-time","type":"string","description":"Hpp payment dueDate"},"subTotal":{"type":"number","description":"Hpp payment subTotal"},"taxAmount":{"type":"number","description":"Hpp payment taxAmount"},"enableTipping":{"type":"boolean","description":"Hpp payment enableTipping"},"items":{"description":"Hpp payment items","type":"array","items":{"type":"string"}},"hideTax":{"type":"boolean","description":"Hide Tax in order-summary on HPP"},"emailCustomer":{"type":"boolean","description":"Hpp payment emailCustomer"}},"required":["email","price","phoneNumber","description","currency","invoiceNumber","referenceName","dueDate","subTotal","taxAmount","enableTipping","items"]},"CustomPaymentLinkResponse":{"type":"object","properties":{"message":{"type":"string","description":"Payment link message."},"link":{"type":"string","description":"Hpp payment link."},"id":{"type":"string","description":"Get paid link unique Id"},"QRCodeImgUrl":{"type":"string","description":"Hpp payment QR COde."}},"required":["message","link","id","QRCodeImgUrl"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.optty.com/hosted-payment-page/optty-direct-sessions/creating-a-session.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
