> For the complete documentation index, see [llms.txt](https://docs.payram.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payram.com/api-integration/payments-api/create-payment.md).

# Create Payment

<figure><img src="/files/QyYn65RkzpewgdHqjX21" alt=""><figcaption></figcaption></figure>

***

## URL Details

<table><thead><tr><th width="157.99609375">Parameter</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>BASE_URL</td><td>Your PayRam Site URL — find it under <strong>Settings → Site URL</strong> in your dashboard. Include the port if you installed on one.</td><td><code>https://pay.example.com</code></td></tr><tr><td>API Endpoint</td><td>Endpoint to create a new payment link.</td><td><code>/api/v1/payment</code></td></tr></tbody></table>

{% hint style="info" %} <mark style="color:$warning;">**Note**</mark> <mark style="color:$success;">**: You can generate a unique API key for each project directly from the PayRam dashboard. This helps you manage and track payouts separately for every project.**</mark>
{% endhint %}

## Headers

<table><thead><tr><th width="129.0859375">Header</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>API-Key</td><td>Your unique PayRam API key generated from your dashboard.</td><td>811b12035f0dfa8ffd62296df3c98b27</td></tr><tr><td>Content-Type</td><td>Format of the request data.</td><td>application/json</td></tr></tbody></table>

## Request Body

<table><thead><tr><th width="150">Field</th><th width="90">Required</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>customerEmail</td><td>Yes</td><td>Customer’s email address where the payment link will be associated.</td><td>test@payram.com</td></tr><tr><td>customerID</td><td>Yes</td><td>Unique identifier for the customer.</td><td>1</td></tr><tr><td>amountInUSD</td><td>Yes</td><td>The payment amount in USD.</td><td>10</td></tr><tr><td>invoiceID</td><td>No</td><td>Your own invoice reference. Returned as <code>invoice_id</code> in the payment webhook.</td><td>INV-0090</td></tr><tr><td>expire</td><td>No</td><td>When the payment link expires, as an RFC 3339 timestamp. Defaults to 24 hours from creation.</td><td>2026-08-20T10:00:00Z</td></tr><tr><td>currency</td><td>No</td><td>Restricts the payment to a single currency. Omit to let the customer choose.</td><td>USDC</td></tr><tr><td>network</td><td>No</td><td>Restricts the payment to a single blockchain. Use together with <code>currency</code>.</td><td>BASE</td></tr></tbody></table>

{% hint style="info" %} <mark style="color:$primary;">**Payment links expire after 24 hours by default.**</mark> <mark style="color:$info;">Once expired, the payment moves to</mark> <mark style="color:$warning;">`CANCELLED`</mark><mark style="color:$info;">. Send</mark> <mark style="color:$warning;">`expire`</mark> <mark style="color:$info;">to set a different window.</mark>
{% endhint %}

## curl request

Before running the command, replace the placeholders with your actual details:

* ${BASE\_URL} → Your PayRam server URL
* \<your\_api\_key> → Your PayRam API key
* Replace the request body fields with real customer data

```bash
curl --location '${BASE_URL}/api/v1/payment' \
--header 'API-Key: <your_api_key>' \
--header 'Content-Type: application/json' \
--data-raw '{
  "customerEmail": "<customer_email>",
  "customerID": "<customer_id>",
  "amountInUSD": <amount_in_usd>
}'
```

## curl response

```
{
  "host": "https://pay.example.com",
  "reference_id": "c80f5363-0397-4761-aa1a-3155c3a21470",
  "url": "https://pay.example.com/payments?reference_id=c80f5363-0397-4761-aa1a-3155c3a21470&host=https://pay.example.com"
}
```

{% hint style="info" %} <mark style="color:$warning;">**Note**</mark> <mark style="color:$success;">**: The url field provides a ready-to-use PayRam payment page. You can share this link directly with your customers, or build a custom UI using other API endpoints.**</mark>
{% endhint %}
