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.

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:

Parameter

Type

Description

paymentID

string

PaymentID in our system. It will be sent in callback (see handling callbacks).

expiryAt

timestamp (RFC3339)

After this date, the link to the payment will be considered expired. Important: If the user has transferred Crypto, the callback will still be sent to your server

url

string

Link with payment instructions. You should redirect user here for payment.

Response Example

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

Last updated