> 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.md).

# Payments API

***

<figure><img src="https://content.gitbook.com/content/wm1DIvbGMREWT1TdLPtz/blobs/CallR4LiFOh4qXvz21xp/payram-payments-api.png" alt=""><figcaption></figcaption></figure>

## Prerequisites

Before using the Payments API, make sure you have the following:

* A PayRam server that is properly hosted and running.
* A valid API Key generated from the PayRam dashboard for authentication.

{% 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 %}

***

## Finding your BASE\_URL

Every endpoint below is called as `{BASE_URL}/api/v1/...`. Your `BASE_URL` is the address your PayRam instance is reachable at — the same one you open the dashboard with.

{% stepper %}
{% step %}

### Open your PayRam dashboard

Log in to your PayRam dashboard as usual.
{% endstep %}

{% step %}

### Go to Settings

Select **Settings** from the left menu.
{% endstep %}

{% step %}

### Open Site URL

Select **Site URL**. The address shown under **Current site URL** is your `BASE_URL`.
{% endstep %}
{% endstepper %}

Depending on how you installed PayRam, it will look like one of these:

| Your setup                    | BASE\_URL                 |
| ----------------------------- | ------------------------- |
| Domain with SSL               | `https://pay.example.com` |
| Server IP, no SSL             | `http://192.168.0.1`      |
| Installed on a different port | `http://192.168.0.1:3000` |

{% hint style="info" %} <mark style="color:$primary;">**Note**</mark><mark style="color:$info;">: PayRam serves the dashboard and the API from the same address, so there is no separate API port. If you installed on a port other than the default, include it in your</mark> <mark style="color:$warning;">`BASE_URL`</mark><mark style="color:$info;">.</mark>
{% endhint %}

{% hint style="warning" %} <mark style="color:$warning;">**Seeing**</mark> <mark style="color:$warning;">`http://`</mark> <mark style="color:$warning;">when your site is HTTPS?</mark> <mark style="color:$info;">If a service such as Cloudflare or a load balancer terminates SSL in front of PayRam, the Site URL can show</mark> <mark style="color:$warning;">`http`</mark><mark style="color:$info;">. The root user can correct the protocol on the same page.</mark>
{% endhint %}

***

## API Endpoints

These are the current endpoints required for the Payments API integration, listed below.

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-cover data-type="image">Cover image</th></tr></thead><tbody><tr><td><strong>Create Payment</strong></td><td>Create a payment link for customers using the PayRam API.</td><td><a href="https://content.gitbook.com/content/wm1DIvbGMREWT1TdLPtz/blobs/x56GsGsbGOGBWmMJC2yw/payram-payment-apis-create-payment.png">payram-payment-apis-create-payment.png</a></td></tr><tr><td><strong>Fetch Tickers</strong></td><td>Fetch supported tickers and token options using the PayRam API.</td><td></td></tr><tr><td><strong>Get Blockchain Currencies</strong></td><td>Fetch blockchain deposit options using a payment’s reference ID.</td><td><a href="https://content.gitbook.com/content/wm1DIvbGMREWT1TdLPtz/blobs/lFo1Aof5UsSuwodjju9o/payram-payment-apis-get-blockchain-currencies.png">payram-payment-apis-get-blockchain-currencies.png</a></td></tr><tr><td><strong>Assign Deposit Address</strong></td><td>Assign a static deposit address to a user for a specific blockchain.</td><td><a href="https://content.gitbook.com/content/wm1DIvbGMREWT1TdLPtz/blobs/4wTeL86ZviiN3VkCxCod/payram-payment-apis-assign-deposit-address.png">payram-payment-apis-assign-deposit-address.png</a></td></tr><tr><td><strong>Payment Status</strong></td><td>Fetch the current payment status using a payment’s reference ID.</td><td><a href="https://content.gitbook.com/content/wm1DIvbGMREWT1TdLPtz/blobs/txWxC3Fhsyt4MylRugMg/payram-payment-payment-status.png">payram-payment-payment-status.png</a></td></tr><tr><td><strong>Webhook</strong></td><td>Receive payment updates on your server instead of polling.</td><td><a href="https://content.gitbook.com/content/wm1DIvbGMREWT1TdLPtz/blobs/CallR4LiFOh4qXvz21xp/payram-payments-api.png">payram-payments-api.png</a></td></tr></tbody></table>
