mirror of
https://github.com/aljazceru/payments-rest-api.git
synced 2026-01-09 00:24:23 +01:00
cleanup fly docs
This commit is contained in:
@@ -46,82 +46,3 @@ This document explains deploying breez payments api to fly.io
|
||||
```bash
|
||||
fly deploy
|
||||
```
|
||||
|
||||
## API Endpoints
|
||||
|
||||
### Health Check
|
||||
|
||||
```
|
||||
GET /health
|
||||
```
|
||||
|
||||
Check if the API is up and running.
|
||||
|
||||
### List Payments
|
||||
|
||||
```
|
||||
GET /list_payments
|
||||
```
|
||||
|
||||
Query Parameters:
|
||||
- `from_timestamp` (optional): Filter payments from this timestamp
|
||||
- `to_timestamp` (optional): Filter payments to this timestamp
|
||||
- `offset` (optional): Pagination offset
|
||||
- `limit` (optional): Pagination limit
|
||||
|
||||
### Receive Payment
|
||||
|
||||
```
|
||||
POST /receive_payment
|
||||
```
|
||||
|
||||
Request Body:
|
||||
```json
|
||||
{
|
||||
"amount": 10000,
|
||||
"method": "LIGHTNING"
|
||||
}
|
||||
```
|
||||
|
||||
### Send Payment
|
||||
|
||||
```
|
||||
POST /send_payment
|
||||
```
|
||||
|
||||
Request Body:
|
||||
```json
|
||||
{
|
||||
"destination": "lnbc...",
|
||||
"amount": 10000,
|
||||
"drain": false
|
||||
}
|
||||
```
|
||||
|
||||
## Client Usage
|
||||
|
||||
See `client.py` for a Python client implementation and example usage.
|
||||
|
||||
### Example usage
|
||||
#### Python
|
||||
You can use `example-client.py`file from this to test the functionality. Take the URL flyctl returned at deploy and API_SECRET and edit the `example-client.py` with correct values
|
||||
|
||||
```
|
||||
API_URL = "YOUR-URL-HERE"
|
||||
API_KEY = "YOUR-SECRET-HERE"
|
||||
```
|
||||
For example-client to work, you need to have python installed together with requests library:
|
||||
```
|
||||
pip install requests
|
||||
```
|
||||
Then run:
|
||||
```
|
||||
python example-client.py
|
||||
```
|
||||
#### curl
|
||||
If you don't have python installed, you can also just run a curl command.
|
||||
|
||||
For example, for the *list_payments* endpoint, run:
|
||||
```
|
||||
curl -X POST "<YOUR-URL-HERE>/list_payments" -H "Content-Type: application/json" -H "x-api-key: <API_SECRET>" -d '{}'
|
||||
```
|
||||
Reference in New Issue
Block a user