Idempotency-Key
Idempotency-Key हेडर में कोई भी UUID भेजें — उसी की के साथ retry वही ऑर्डर लौटाता है, नया नहीं बनाता. Timeout और retries के लिए ज़रूरी.
Header
Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000
REST API for partners. Single Bearer key, idempotent requests, JSON in/out — zero ceremony.
बॉट को /api भेजें — वो osk_… की देगा. इसे गुप्त रखें.
POST /orders/stars रिसीवर और मात्रा के साथ.
रेस्पॉन्स में order_id, पेमेंट पता, memo और TTL.
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"
}'
{
"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"
}
}
हर रिक्वेस्ट Authorization: Bearer osk_… हेडर से ऑथेंटिकेट होती है. एक की = एक पार्टनर और एक TON टॉप-अप पता.
GET /api/v1/balance HTTP/1.1
Host: api.theopenmoney.info
Authorization: Bearer osk_••••••••••••••••
Accept: application/json
/orders/starsCreate a Stars order/orders/premiumCreate a Premium order (3 / 6 / 12 months)/orders/{id}Get order by ID/ordersList orders/orders/by-memo/{memo}Find order by payment_memo/orders/by-reference/{ref}Find orders by your client_reference/orders/stats/summaryAggregate stats/orders/{id}/cancelCancel a pending_payment order/pricing/ton-rateCurrent TON/USD rate/pricing/feeService fees and min/max limits/pricing/estimate/starsEstimate Stars price in TON/pricing/estimate/premiumEstimate Premium price in TON/recipients/starsCheck if a username can receive Stars/recipients/premiumCheck if a username can receive Premium/balancePartner balance and top-up address/balance/transactionsBalance transactions history/healthService health probecurl -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"
}'
curl https://api.theopenmoney.info/api/v1/orders/10421 \
-H "Authorization: Bearer $KEY"
curl "https://api.theopenmoney.info/api/v1/recipients/stars?username=pandus" \
-H "Authorization: Bearer $KEY"
curl "https://api.theopenmoney.info/api/v1/pricing/estimate/stars?quantity=100" \
-H "Authorization: Bearer $KEY"
Idempotency-Key हेडर में कोई भी UUID भेजें — उसी की के साथ retry वही ऑर्डर लौटाता है, नया नहीं बनाता. Timeout और retries के लिए ज़रूरी.
Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000
ऑर्डर बनाते समय वैकल्पिक रूप से अपनी ID (इनवॉइस नंबर, payment_id) जोड़ें. बाद में: GET /orders/by-reference/{ref} सभी जुड़े ऑर्डर लौटाता है.
{
"client_reference": "invoice-42"
}
सभी एरर एक ही JSON: ok=false, पठनीय error_code और error_message.
{
"ok": false,
"error_code": "VALIDATION_ERROR",
"error_message": "quantity must be between 50 and 10000",
"data": null
}