REST API Reference
Complete REST API documentation for Pelago.
Payments
Create Payment
POST /v1/payments
Request Body:
| Field | Type | Required | Description |
|---|---|---|---|
amount | number | ✓ | Payment amount |
currency | string | ✓ | ISO currency (USD, EUR) |
cryptocurrency | string | ✓ | USDC, USDT, DAI |
network | string | ✓ | stellar, ethereum, polygon |
merchantWallet | string | ✓ | Merchant wallet address |
redirectUrl | string | Success redirect URL | |
webhookUrl | string | Webhook endpoint | |
expiresIn | number | Seconds until expiry (default: 1800) | |
metadata | object | Custom key-value data |
Example:
curl -X POST https://api.pelago.tech/v1/payments \
-H "Authorization: Bearer pk_live_xxxxx" \
-H "X-Api-Secret: sk_live_xxxxx" \
-H "Content-Type: application/json" \
-d '{
"amount": 100,
"currency": "USD",
"cryptocurrency": "USDC",
"network": "stellar",
"merchantWallet": "GXXXXX..."
}'
Response:
{
"id": "pay_abc123",
"object": "payment",
"status": "created",
"amount": 100.00,
"currency": "USD",
"cryptoAmount": "100.000000",
"cryptocurrency": "USDC",
"network": "stellar",
"url": "https://pay.pelago.tech/pay_abc123",
"qrCode": "data:image/png;base64,...",
"expiresAt": "2025-02-08T23:00:00Z",
"createdAt": "2025-02-08T22:30:00Z"
}
Retrieve Payment
GET /v1/payments/:id
Response: Same as create.
List Payments
GET /v1/payments
Query Parameters:
| Param | Type | Description |
|---|---|---|
limit | number | Max results (1-100) |
starting_after | string | Pagination cursor |
status | string | Filter by status |
created_gte | string | Created after (ISO) |
created_lte | string | Created before (ISO) |
Cancel Payment
POST /v1/payments/:id/cancel
Refunds
Create Refund
POST /v1/refunds
Request Body:
| Field | Type | Required | Description |
|---|---|---|---|
paymentId | string | ✓ | Original payment ID |
amount | number | Refund amount (full if omitted) | |
reason | string | Refund reason |
Retrieve Refund
GET /v1/refunds/:id
List Refunds
GET /v1/refunds
Settlements
List Settlements
GET /v1/settlements
Query Parameters:
| Param | Type | Description |
|---|---|---|
status | string | pending, completed, failed |
startDate | string | Start date (ISO) |
endDate | string | End date (ISO) |
Retrieve Settlement
GET /v1/settlements/:id
Merchants
Get Merchant
GET /v1/merchant
Update Settings
PATCH /v1/merchant/settings
Request Body:
{
"settlementCurrency": "USDC",
"settlementSchedule": {
"frequency": "daily",
"time": "18:00"
}
}
HTTP Status Codes
| Code | Description |
|---|---|
| 200 | Success |
| 201 | Created |
| 400 | Bad Request |
| 401 | Unauthorized |
| 404 | Not Found |
| 429 | Rate Limited |
| 500 | Server Error |