# API : P-Link creation

## Creating a dynamic link (API)

You can create a P-Link **on the fly** via the API&#x20;

`POST /api/createPLink`.

This method allows access to additional advanced settings, such as customizing an image, title, or description on the payment page..

### Example in JavaScript

```js
const req = await fetch("https://p-link.io/api/createPLink", {
  method: "POST",
  body: JSON.stringify({
    webhook: "https://my-site.com/webhook",
    notificationEmail: "contact@example.com",
    receivingPayment: "<WalletAddress>",
    returnOKURL: "https://my-site.com/success",
    returnURL: "https://my-site.com/cancel",
    autoConvertToUSD: "1",
    amount: 9.99,
    currency: "USD",
    description: "Product description",
    title: "Title displayed",
    logo: "https://mon-site.com/logo.png",
    expiryDate: Math.floor(Date.now() / 1000) + 60*60*24*15,
    selfDestruct: 1,
    param: "xyz"
  })
});

const plink_Info = await req.json();
console.log(plink_Info);

```

```

{
  "link": "https://p-link.io/...",
  "secret": "secret-key"
}

```


---

# 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.p-link.io/api-p-link-creation/api-p-link-creation.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.
