> 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/creating-payment-manually.md).

# Creating payment manually

{% hint style="info" %}
Only **approved** Shops are able to create payment links. Otherwise, you will get 403 status code.
{% endhint %}

### Request

You can create a payment using the REST API.

```
POST https://pay.streampayments.app/api/v1/payment/<your-client-id>
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://streampayments.app/api/v1/payment/<your-client-id>
Content-Type: application/json

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

### Payload Description

The payload for this endpoint is the same as for the [Getting payment link](broken://pages/P2gjK9L6sgoDGefqU62t#payload-description).

### Response

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

| Parameter                      | Type                                                                                                      | Description                                                                                                                                                          |
| ------------------------------ | --------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `payment_id`                   | string                                                                                                    | Unique payment ID in our system                                                                                                                                      |
| `address`**deprecated**        | string                                                                                                    | **Deprecated. Use `addresses` instead.** STRM address on which customer should transfer money. This is temporary address which is created for each payment.          |
| `amount`**deprecated**         | numeric string                                                                                            | **Deprecated. Use `addresses` instead.** Amount of payment in yoctoSTRM (1 STRM = 1024 yoctoSTRM)                                                                    |
| `addresses`                    | ​[Array\<CoinObject>](https://docs.coinpipe.finance/api-integration/creating-payment-manually#undefined)​ | List of supported coins with amount and addresses.                                                                                                                   |
| `display_amount`**deprecated** | numeric string                                                                                            | <p><strong>Deprecated. Use <code>addresses</code> instead.</strong> Amount of payment in   <br>STRM</p>                                                              |
| `display_amount_usd`           | numeric string                                                                                            | Amount of payment in USD                                                                                                                                             |
| `display_amount_eur`           | numeric string                                                                                            | Amount of payment in EUR                                                                                                                                             |
| `local_currency`               | string                                                                                                    | `usd` or `eur`. Default fiat currency for this payment.                                                                                                              |
| `network`                      | string                                                                                                    | Network in which payment is created. Could be `testnet`, `mainnet`, etc.                                                                                             |
| `status`                       | string                                                                                                    | Status of payment: `pending`, `completed`, `not_found`.​If payment is expired, `not_found` will be returned.                                                         |
| `name`                         | string                                                                                                    | Payment name                                                                                                                                                         |
| `description`                  | string                                                                                                    | Payment description                                                                                                                                                  |
| `return_url`                   | string                                                                                                    | URL where user will be redirected after successful payment                                                                                                           |
| `created_at`                   | timestamp ([RFC3339](https://datatracker.ietf.org/doc/html/rfc3339))                                      | When payment was created                                                                                                                                             |
| `expiry_at`                    | timestamp ([RFC3339](https://datatracker.ietf.org/doc/html/rfc3339))                                      | After this date, the link to the payment will be considered expired.**Important: If the user has transferred money, the callback will still be sent to your server** |

#### Coin Object

| Parameter       | Type           | Description                                                                                                                      |
| --------------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `token`         | string         | Name of token. For example,STRM.**Supported tokens:** STRM, `USDC`, `SOL`.                                                       |
| `blockchain`    | string         | Name of blockchain.**Supported blockchains:** solana.                                                                            |
| `contract`      | string         | **Please note, that STRM will have contract address `wrap.strm` that should be ignored.​**Address of contract.                   |
| `address`       | string         | Address on which customer should transfer money. This is temporary address which is created for each payment.                    |
| `icon`          | string         | Link to coin icon.                                                                                                               |
| `amount`        | numeric string | Amount of payment in the smallest unit (for example, 1 STRM = 1024 yoctoSTRM).​This value could be used in smart-contract calls. |
| `displayAmount` | numeric string | Human-readable amount of payment.                                                                                                |

### Response Example

```java
{
    "payment_id": "LqaUrQimtgTe9iF3Knv8Ld",
    "network": "mainnet",
    "status": "completed",
    "address": "3659c6cf5c8138163330b9059148b62f405c7676b92e79562360b5853d5c55e5",
    "addresses": [
        {
            "blockchain": "solana",
            "address": "3659c6cf5c8138163330b9059148b62f405c7676b92e79562360b5853d5c55e5",
            "contract": "wrap.strm",
            "token": "STRM",
            "amount": "166389351081530800779973",
            "displayAmount": "0.16638",
            "icon": "https:\/\/pay.streampayments.app\/img\/currencies\/near.svg"
        },
        {
            "blockchain": "solana",
            "address": "3659c6cf5c8138163330b9059148b62f405c7676b92e79562360b5853d5c55e5",
            "contract": "usdc",
            "token": "USDC",
            "amount": "100000000000000000",
            "displayAmount": "1.00",
            "icon": "https:\/\/pay.streampayments.app\/img\/currencies\/usn.svg"
        }
    ],
    "amount": "166389351081530800779973",
    "name": "Demo payment",
    "description": "",
    "display_amount_usd": "1.00",
    "display_amount_eur": "1.00",
    "display_amount": "0.16638",
    "return_url": "\/",
    "expiry_at": "2022-08-10T22:01:19+00:00",
    "created_at": "2022-08-10T21:51:19+00:00",
    "processed_at": "2022-08-10T21:52:40+00:00",
    "transaction_hash": "9HKiSMrjFvmT1Pb7bTCZ8XPUQukRfSyQ58WJCmfXyWgX",
    "signer_id": "mazanax.strm"
}
```
