> For the complete documentation index, see [llms.txt](https://streampay.gitbook.io/stream-payment-gateway/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://streampay.gitbook.io/stream-payment-gateway/api-documentation/getting-payment-link.md).

# Getting payment link

### Request

You can get a payment link using the REST API.

```
POST https://pay.streampayments.app/api/v1/payment/<your-client-id>/page
Content-Type: application/json

{
    "amount_usd": "15.89",
    "name": "My Super Shop Order #34254",
    "description": "Coca-Cola x2 - 1.98\nCheetos Cheese - 1.99\nSnickers x2 - 2.38\nFace Masks - 6.29\nDelivery - 3.25",
    "return_url": "https://your.user.example.com/payment-return-url"
}
```

You can also send the amount in STRM, for this you need to send the `amount` parameter instead of `amount_usd` / `amount_eur`

```
POST https://pay.streampayments.app/api/v1/payment/<your-client-id>/page
Content-Type: application/json

{
  "amount": "0.02",
  "name": "Donation to @youruniqueusername",
  "return_url": "https://your.user.example.com/payment-return-url"
}
```

### Payload Description

You have to send API Integration Client ID instead of `<your-client-id>` URI param. You can find your client id [here](https://app.coinpipe.finance/merchants).

| Parameter     | Type   | Required? | Description                                                                                                         |
| ------------- | ------ | --------- | ------------------------------------------------------------------------------------------------------------------- |
| `amount_usd`  | string | ​         | **One of `amount_usd`, `amount_eur` or `amount` required.** Amount in USD. Will be converted into NEAR on our side. |
| `amount_eur`  | string | ​         | **One of `amount_usd`, `amount_eur` or `amount` required.** Amount in EUR. Will be converted into NEAR on our side. |
| `amount`      | string | ​         | **One of `amount_usd` or `amount` required.** Amount in NEAR.                                                       |
| `name`        | string | YES       | Name of payment. Could contain short description what user pays for.                                                |
| `description` | string | NO        | More detailed description. For example, you can pass list of purchased goods or services.                           |
| `return_url`  | string | YES       | URL to which user should be redirected after payment.                                                               |

### Response

In response you will get **PaymentPageObject** which contains the following data:

<table data-header-hidden><thead><tr><th></th><th width="40"></th><th></th></tr></thead><tbody><tr><td>Parameter</td><td>Type</td><td>Description</td></tr><tr><td><code>paymentID</code></td><td>string</td><td>PaymentID in our system. It will be sent in callback <a href="https://docs.coinpipe.finance/api-integration/handling-callbacks">(see handling callbacks)</a>.</td></tr><tr><td><code>expiryAt</code></td><td>timestamp (<a href="https://datatracker.ietf.org/doc/html/rfc3339">RFC3339</a>)</td><td>After this date, the link to the payment will be considered expired. <strong>Important: If the user has transferred Crypto, the callback will still be sent to your server</strong></td></tr><tr><td><code>url</code></td><td>string</td><td>Link with payment instructions. You should redirect user here for payment.</td></tr></tbody></table>

### Response Example

```java
{
    "paymentID": "LGC1IV87HCQusZInLv5kKK",
    "expiryAt": "2022-04-07T10:44:48+03:00",
    "url": "http:\/\/pay.streampayments.app\/payment\/LGC1IV87HCQusZInLv5kKK"
}
```
