Skip to main content

REST API Reference

Complete REST API documentation for Pelago.

Payments

Create Payment

POST /v1/payments

Request Body:

FieldTypeRequiredDescription
amountnumberPayment amount
currencystringISO currency (USD, EUR)
cryptocurrencystringUSDC, USDT, DAI
networkstringstellar, ethereum, polygon
merchantWalletstringMerchant wallet address
redirectUrlstringSuccess redirect URL
webhookUrlstringWebhook endpoint
expiresInnumberSeconds until expiry (default: 1800)
metadataobjectCustom 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:

ParamTypeDescription
limitnumberMax results (1-100)
starting_afterstringPagination cursor
statusstringFilter by status
created_gtestringCreated after (ISO)
created_ltestringCreated before (ISO)

Cancel Payment

POST /v1/payments/:id/cancel

Refunds

Create Refund

POST /v1/refunds

Request Body:

FieldTypeRequiredDescription
paymentIdstringOriginal payment ID
amountnumberRefund amount (full if omitted)
reasonstringRefund reason

Retrieve Refund

GET /v1/refunds/:id

List Refunds

GET /v1/refunds

Settlements

List Settlements

GET /v1/settlements

Query Parameters:

ParamTypeDescription
statusstringpending, completed, failed
startDatestringStart date (ISO)
endDatestringEnd 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

CodeDescription
200Success
201Created
400Bad Request
401Unauthorized
404Not Found
429Rate Limited
500Server Error