TheOpenMoney
The Open Money
For developers

API para socios.

REST API for partners. Single Bearer key, idempotent requests, JSON in/out — zero ceremony.

BASE URL
https://api.theopenmoney.info/api/v1
Auth
Authorization: Bearer
Format
REST · JSON

Quickstart

Tres pasos hasta tu primer pedido.

Step 01

Obtén la clave

Escribe al bot /api — te dará una clave osk_… Mantenla secreta.

Step 02

Envía la solicitud

POST /orders/stars con el destinatario y la cantidad.

Step 03

Recibe el resultado

La respuesta contiene order_id, dirección de pago, memo y TTL.

POST /orders/stars
curl -X POST https://api.theopenmoney.info/api/v1/orders/stars \
-H "Authorization: Bearer $KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"recipient_username": "pandus",
"quantity": 100,
"payment_method": "ton_memo",
"payment_currency": "TON",
"client_reference": "invoice-42"
}'
200 OK · JSON response
{
"ok": true,
"data": {
"id": 10421,
"status": "pending_payment",
"order_type": "stars",
"stars_amount": 100,
"recipient_username": "pandus",
"price_ton": 0.418,
"payment_address": "UQBFJTkJ5hZdH7i6rWQTnm43zn6h2dPBV9lFZ2e98WvWABy_",
"payment_memo": "STARS-a1b2c3",
"expires_at": "2026-04-16T12:15:00Z",
"created_at": "2026-04-16T12:00:00Z"
}
}

Auth

Un header.

Cada solicitud se autentica con el header Authorization: Bearer osk_… Una clave = un socio y una dirección TON de recarga.

  • Nunca pongas la clave en código cliente o URLs.
  • El rate limit se aplica por clave.
  • ¿Comprometida? Revócala y pide una nueva en el bot.
HTTP request
GET /api/v1/balance HTTP/1.1
Host: api.theopenmoney.info
Authorization: Bearer osk_
Accept: application/json

Endpoints

Todos los endpoints.

En Swagger
Orders
  • POST/orders/starsCreate a Stars order
  • POST/orders/premiumCreate a Premium order (3 / 6 / 12 months)
  • GET/orders/{id}Get order by ID
  • GET/ordersList orders
  • GET/orders/by-memo/{memo}Find order by payment_memo
  • GET/orders/by-reference/{ref}Find orders by your client_reference
  • GET/orders/stats/summaryAggregate stats
  • POST/orders/{id}/cancelCancel a pending_payment order
Pricing
  • GET/pricing/ton-rateCurrent TON/USD rate
  • GET/pricing/feeService fees and min/max limits
  • GET/pricing/estimate/starsEstimate Stars price in TON
  • GET/pricing/estimate/premiumEstimate Premium price in TON
Recipients
  • GET/recipients/starsCheck if a username can receive Stars
  • GET/recipients/premiumCheck if a username can receive Premium
Balance
  • GET/balancePartner balance and top-up address
  • GET/balance/transactionsBalance transactions history
Health
  • GET/healthService health probe

Examples

Recetas curl.

Crear pedido de Stars
POST /orders/stars
curl -X POST https://api.theopenmoney.info/api/v1/orders/stars \
-H "Authorization: Bearer $KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"recipient_username": "pandus",
"quantity": 100,
"payment_method": "ton_memo",
"payment_currency": "TON",
"client_reference": "invoice-42"
}'
Consultar estado
GET /orders/{id}
curl https://api.theopenmoney.info/api/v1/orders/10421 \
-H "Authorization: Bearer $KEY"
Verificar destinatario
GET /recipients/stars
curl "https://api.theopenmoney.info/api/v1/recipients/stars?username=pandus" \
-H "Authorization: Bearer $KEY"
Calcular precio
GET /pricing/estimate/stars
curl "https://api.theopenmoney.info/api/v1/pricing/estimate/stars?quantity=100" \
-H "Authorization: Bearer $KEY"

Reliability

Retry-safe by design.

Idempotency-Key

Pasa cualquier UUID en el header Idempotency-Key — un retry con la misma clave devuelve el mismo pedido en lugar de crear uno nuevo. Esencial para timeouts y retries.

Header
Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000

client_reference

Adjunta opcionalmente tu propio ID (número de factura, payment_id) al crear el pedido. Luego: GET /orders/by-reference/{ref} devuelve todos los pedidos vinculados.

Body field
{
"client_reference": "invoice-42"
}

Un solo formato.

Todos los errores tienen el mismo JSON: ok=false, error_code legible y error_message.

Códigos comunes
401
Bearer token ausente o inválido
404
Recurso no encontrado (o no pertenece a tu clave)
409
Conflicto de estado — p. ej., no se puede cancelar un pedido pagado
422
Parámetros de solicitud inválidos
429
Rate limit superado
Error response
{
"ok": false,
"error_code": "VALIDATION_ERROR",
"error_message": "quantity must be between 50 and 10000",
"data": null
}

¿Listo paraempezar?

El esquema interactivo completo está en Swagger. La clave — a un comando del bot.