API reference

GramNumber Virtual Numbers API

OpenAPI 1.0.0

Download openapi.yaml Base URL: https://www.gramnumber.com

Public catalog endpoints require no authentication.

Sales API (/api/v1/*) uses a Bearer token tied to a user wallet. Each successful checkout debits that user's balance exactly like the web storefront.

Virtual numbers

  • Catalog (no auth): GET /api/v1/catalog/services, GET /api/v1/catalog/services/{service}/prices
  • Purchase (Bearer): POST /api/v1/checkout
  • Orders (Bearer): GET /api/v1/orders, GET /api/v1/orders/{id}, GET /api/v1/orders/{id}/code, POST /api/v1/orders/{id}/cancel

Telegram Stars, Premium & Gifts

  • Catalog (no auth): GET /api/v1/catalog/telegram/stars, GET /api/v1/catalog/telegram/premium, GET /api/v1/catalog/telegram/gifts/collections, GET /api/v1/catalog/telegram/gifts?collection_id=..., POST /api/v1/catalog/telegram/gifts/quote
  • Purchase (Bearer): POST /api/v1/telegram/stars, POST /api/v1/telegram/premium, POST /api/v1/telegram/gifts
  • Gift payment (Bearer, when balance is short): GET|POST /api/v1/telegram/orders/{id}/payment, POST /api/v1/telegram/orders/{id}/complete, POST /api/v1/telegram/orders/{id}/cancel
  • Orders (Bearer): GET /api/v1/telegram/orders, GET /api/v1/telegram/orders/{id}

Gift purchase flow

  1. List collections → list gifts (or quote a gift_slug) → POST /api/v1/telegram/gifts with gift_slug + user_tag.
  2. If the wallet covers the quote → 201 and the gift is paid + transferred (awaiting_payment: false).
  3. If the wallet is short → 202 with a pending (or later not_enough) order, no debit yet, and a payment helper object (status / top-up / complete URLs).
  4. Top up via Cryptomus (POST .../payment → open pay_url), poll GET .../payment until can_complete, then POST .../complete to debit and deliver.
  5. Cancel with POST .../cancel while awaiting payment (no refund if wallet_debited is false). If supplier price rises while waiting, status becomes not_enough and remaining credits increase.

SecureTD (Telegram accounts)

  • Catalog (no auth): GET /api/v1/catalog/securetd/categories, GET /api/v1/catalog/securetd/categories/{categoryId}/products, GET /api/v1/catalog/securetd/search?q=...
  • Purchase (Bearer): POST /api/v1/securetd/checkout
  • Orders (Bearer): GET /api/v1/securetd/orders, GET /api/v1/securetd/orders/{id}, GET /api/v1/securetd/orders/{id}/download

Custom Tdata (separate catalog & checkout — not SecureTD; same URL shape as SecureTD)

  • Catalog (no auth): GET /api/v1/catalog/custom-tdata/categories, GET /api/v1/catalog/custom-tdata/categories/{categoryId}/products, GET /api/v1/catalog/custom-tdata/search?q=...
  • Purchase (Bearer): POST /api/v1/custom-tdata/checkout with product_id, quantity
  • Orders (Bearer): GET /api/v1/custom-tdata/orders, GET /api/v1/custom-tdata/orders/{id}, GET /api/v1/custom-tdata/orders/{id}/download

Gift cards

  • Catalog (no auth): GET /api/v1/catalog/gift-cards/categories, GET /api/v1/catalog/gift-cards/categories/{categoryId}
  • Purchase (Bearer): POST /api/v1/gift-cards/checkout
  • Pending payment (Bearer, when balance is short): GET|POST /api/v1/gift-cards/orders/{id}/payment, POST /api/v1/gift-cards/orders/{id}/complete, POST /api/v1/gift-cards/orders/{id}/cancel
  • Orders (Bearer): GET /api/v1/gift-cards/orders, GET /api/v1/gift-cards/orders/{id}

Gift card purchase flow

  1. List categories → open one category for card_id offers → POST /api/v1/gift-cards/checkout with category_id, card_id, optional quantity.
  2. If the wallet covers the price → 201 and fulfillment starts (awaiting_payment: false). Completed orders include codes.
  3. If the wallet is short → 202 with a pending order, no debit yet, and a payment helper object.
  4. Top up via Cryptomus (POST .../payment → open pay_url), poll GET .../payment until can_complete, then POST .../complete.
  5. Cancel with POST .../cancel while awaiting payment (refunds only if wallet_debited was true).

Create a token on the server: php artisan sales-api:create-token user@example.com my-integration

Interactive reference: {APP_URL}/docs/api

Authentication

Sales endpoints require a bearer token tied to your wallet. Send it on every authenticated request:

Authorization: Bearer gn_<secret>

Create a token in your profile or on the server: php artisan sales-api:create-token user@example.com my-integration

Catalog

Public service list and live prices

GET /api/v1/catalog/services Public

List all public services

Responses

  • 200 Non-empty catalog CatalogServicesResponse
  • {
        "ok": true,
        "message": "string",
        "services": [
            {}
        ],
        "featured": {
            "primary": [
                {}
            ],
            "more": [
                {}
            ]
        },
        "irr_per_usd": 1,
        "markup_percent": 1
    }
  • 503 Upstream unavailable and no cached services ErrorResponse
  • {
        "ok": false,
        "message": "string"
    }

Example cURL

curl -sS -X GET "https://www.gramnumber.com/api/v1/catalog/services" \
  -H "Accept: application/json"
GET /api/v1/catalog/services/{service}/prices Public

Live price rows for one service

Parameters

Name In Type Required Description
service path string Yes Service identifier: `telegram`, numeric Ozvinoo id, or `sim_{slug}` for 5sim (e.g. `sim_whatsapp`).

Responses

  • 200 Price rows PricesResponse
  • {
        "ok": true,
        "message": "string",
        "rows": [
            {
                "country": "string",
                "range": "string",
                "count": "string",
                "base_price": 1,
                "price": 1,
                "usd": 1
            }
        ],
        "markup_percent": 1,
        "irr_per_usd": 1
    }
  • 404 Unknown service
  • 502 Upstream error ErrorResponse
  • {
        "ok": false,
        "message": "string"
    }

Example cURL

curl -sS -X GET "https://www.gramnumber.com/api/v1/catalog/services/{service}/prices" \
  -H "Accept: application/json"

Sales

Authenticated wallet checkout & order lookup

GET /api/v1/me Bearer token

Current token owner profile & wallet

Responses

  • 200 Response MeResponse
  • {
        "ok": true,
        "user": {
            "id": 1,
            "email": "user@example.com",
            "name": "string",
            "balance_credits": 1,
            "balance_usd_display": "$12.34"
        },
        "virtual_numbers": {
            "catalog_services": "GET /api/v1/catalog/services",
            "catalog_prices": "GET /api/v1/catalog/services/{service}/prices",
            "checkout": "POST /api/v1/checkout",
            "list_orders": "GET /api/v1/orders",
            "show_order": "GET /api/v1/orders/{id}",
            "poll_sms_code": "GET /api/v1/orders/{id}/code",
            "cancel_order": "POST /api/v1/orders/{id}/cancel"
        },
        "telegram": {
            "catalog_stars": "GET /api/v1/catalog/telegram/stars",
            "catalog_premium": "GET /api/v1/catalog/telegram/premium",
            "catalog_gift_collections": "GET /api/v1/catalog/telegram/gifts/collections",
            "catalog_gifts": "GET /api/v1/catalog/telegram/gifts?collection_id={id}",
            "quote_gift": "POST /api/v1/catalog/telegram/gifts/quote",
            "purchase_stars": "POST /api/v1/telegram/stars",
            "purchase_premium": "POST /api/v1/telegram/premium",
            "purchase_gift": "POST /api/v1/telegram/gifts",
            "list_orders": "GET /api/v1/telegram/orders",
            "show_order": "GET /api/v1/telegram/orders/{id}",
            "gift_payment_status": "GET /api/v1/telegram/orders/{id}/payment",
            "gift_payment_topup": "POST /api/v1/telegram/orders/{id}/payment",
            "gift_payment_complete": "POST /api/v1/telegram/orders/{id}/complete",
            "cancel_order": "POST /api/v1/telegram/orders/{id}/cancel"
        },
        "securetd": {
            "catalog_categories": "GET /api/v1/catalog/securetd/categories",
            "catalog_products": "GET /api/v1/catalog/securetd/categories/{categoryId}/products",
            "search": "GET /api/v1/catalog/securetd/search?q=...",
            "checkout": "POST /api/v1/securetd/checkout",
            "list_orders": "GET /api/v1/securetd/orders",
            "show_order": "GET /api/v1/securetd/orders/{id}",
            "download": "GET /api/v1/securetd/orders/{id}/download"
        },
        "custom_tdata": {
            "catalog_categories": "GET /api/v1/catalog/custom-tdata/categories",
            "catalog_products": "GET /api/v1/catalog/custom-tdata/categories/{categoryId}/products",
            "search": "GET /api/v1/catalog/custom-tdata/search?q=...",
            "checkout": "POST /api/v1/custom-tdata/checkout",
            "list_orders": "GET /api/v1/custom-tdata/orders",
            "show_order": "GET /api/v1/custom-tdata/orders/{id}",
            "download": "GET /api/v1/custom-tdata/orders/{id}/download"
        },
        "gift_cards": {
            "catalog_categories": "GET /api/v1/catalog/gift-cards/categories",
            "catalog_category": "GET /api/v1/catalog/gift-cards/categories/{categoryId}",
            "checkout": "POST /api/v1/gift-cards/checkout",
            "list_orders": "GET /api/v1/gift-cards/orders",
            "show_order": "GET /api/v1/gift-cards/orders/{id}",
            "payment_status": "GET /api/v1/gift-cards/orders/{id}/payment",
            "payment_topup": "POST /api/v1/gift-cards/orders/{id}/payment",
            "complete": "POST /api/v1/gift-cards/orders/{id}/complete",
            "cancel": "POST /api/v1/gift-cards/orders/{id}/cancel"
        }
    }
  • 401 Response Unauthorized
  • {
        "message": "Invalid API token."
    }

Example cURL

curl -sS -X GET "https://www.gramnumber.com/api/v1/me" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer gn_<your_token>"
POST /api/v1/checkout Bearer token

Purchase one or more numbers (wallet debit)

Same payload semantics as authenticated web batch checkout (POST /shop/purchase-batch). Up to 25 lines per request. Each item is one logical line (service + country_range); use the storefront or /api/v1/catalog/services/{service}/prices to obtain valid country_range values.

Request body CheckoutRequest

{
    "items": [
        {
            "service": "string",
            "country_range": "string"
        }
    ]
}

Responses

  • 201 All lines purchased CheckoutSuccess
  • {
        "ok": true,
        "had_awaiting_supplier": true,
        "orders": [
            {
                "id": 1,
                "order_number": "GN-10042",
                "status": "pending_sms",
                "supplier": "ozvinoo",
                "service_title": "string",
                "country_label": "string",
                "phone": "string",
                "external_request_id": 1,
                "sms_code": "string",
                "price_charged_credits": 1,
                "created_at": "string"
            }
        ]
    }
  • 401 Response Unauthorized
  • {
        "message": "Invalid API token."
    }
  • 402 Insufficient wallet balance CheckoutFailure
  • {
        "ok": false,
        "message": "string",
        "wallet": true,
        "partial_orders": [
            {
                "id": 1,
                "order_number": "GN-10042",
                "status": "pending_sms",
                "supplier": "ozvinoo",
                "service_title": "string",
                "country_label": "string",
                "phone": "string",
                "external_request_id": 1,
                "sms_code": "string",
                "price_charged_credits": 1,
                "created_at": "string"
            }
        ]
    }
  • 422 Validation or business error (includes partial_orders if some lines succeeded) CheckoutFailure
  • {
        "ok": false,
        "message": "string",
        "wallet": true,
        "partial_orders": [
            {
                "id": 1,
                "order_number": "GN-10042",
                "status": "pending_sms",
                "supplier": "ozvinoo",
                "service_title": "string",
                "country_label": "string",
                "phone": "string",
                "external_request_id": 1,
                "sms_code": "string",
                "price_charged_credits": 1,
                "created_at": "string"
            }
        ]
    }

Example cURL

curl -sS -X POST "https://www.gramnumber.com/api/v1/checkout" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer gn_<your_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "items": [
        {
            "service": "string",
            "country_range": "string"
        }
    ]
}'
GET /api/v1/orders Bearer token

List virtual number orders

Returns the most recent virtual number orders for the token owner. Optional limit query (1–100, default 50).

Parameters

Name In Type Required Description
limit query integer No —

Responses

  • 200 Response VirtualNumberOrdersListResponse
  • {
        "ok": true,
        "orders": [
            {
                "id": 1,
                "order_number": "GN-10042",
                "status": "pending_sms",
                "supplier": "ozvinoo",
                "service_title": "string",
                "country_label": "string",
                "phone": "string",
                "external_request_id": 1,
                "sms_code": "string",
                "price_charged_credits": 1,
                "created_at": "string"
            }
        ]
    }
  • 401 Response Unauthorized
  • {
        "message": "Invalid API token."
    }

Example cURL

curl -sS -X GET "https://www.gramnumber.com/api/v1/orders" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer gn_<your_token>"
GET /api/v1/orders/{order} Bearer token

Get one order by id (must belong to token user)

Parameters

Name In Type Required Description
order path integer Yes —

Responses

  • 200 Response
  • {
        "ok": true,
        "order": {
            "id": 1,
            "order_number": "GN-10042",
            "status": "pending_sms",
            "supplier": "ozvinoo",
            "service_title": "string",
            "country_label": "string",
            "phone": "string",
            "external_request_id": 1,
            "sms_code": "string",
            "price_charged_credits": 1,
            "created_at": "string"
        }
    }
  • 401 Response Unauthorized
  • {
        "message": "Invalid API token."
    }
  • 404 Not found or not owned by this user

Example cURL

curl -sS -X GET "https://www.gramnumber.com/api/v1/orders/{order}" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer gn_<your_token>"
GET /api/v1/orders/{order}/code Bearer token

Poll SMS verification code

Poll while status is pending_sms. When the supplier delivers the code, status becomes completed and sms_code is set. Same supplier logic as the web storefront poll endpoint.

Parameters

Name In Type Required Description
order path integer Yes —

Responses

  • 200 Response OrderPollResponse
  • {
        "ok": true,
        "status": "pending_sms",
        "sms_code": "string",
        "order": {
            "id": 1,
            "order_number": "GN-10042",
            "status": "pending_sms",
            "supplier": "ozvinoo",
            "service_title": "string",
            "country_label": "string",
            "phone": "string",
            "external_request_id": 1,
            "sms_code": "string",
            "price_charged_credits": 1,
            "created_at": "string"
        }
    }
  • 401 Response Unauthorized
  • {
        "message": "Invalid API token."
    }
  • 404 Not found or not owned by this user

Example cURL

curl -sS -X GET "https://www.gramnumber.com/api/v1/orders/{order}/code" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer gn_<your_token>"
POST /api/v1/orders/{order}/cancel Bearer token

Cancel a virtual number order

Cancels pending_sms orders (refunds wallet) or refunds awaiting_supplier lines. Other statuses return HTTP 422.

Parameters

Name In Type Required Description
order path integer Yes —

Responses

  • 200 Response OrderCancelResponse
  • {
        "ok": true,
        "refunded": true,
        "order": {
            "id": 1,
            "order_number": "GN-10042",
            "status": "pending_sms",
            "supplier": "ozvinoo",
            "service_title": "string",
            "country_label": "string",
            "phone": "string",
            "external_request_id": 1,
            "sms_code": "string",
            "price_charged_credits": 1,
            "created_at": "string"
        }
    }
  • 401 Response Unauthorized
  • {
        "message": "Invalid API token."
    }
  • 404 Not found or not owned by this user
  • 422 Cancel not allowed for this status ErrorResponse
  • {
        "ok": false,
        "message": "string"
    }

Example cURL

curl -sS -X POST "https://www.gramnumber.com/api/v1/orders/{order}/cancel" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer gn_<your_token>"

Telegram

Telegram Stars, Premium & Gifts catalog and wallet checkout

GET /api/v1/catalog/telegram/stars Public

Telegram Stars packs and pricing

Responses

  • 200 Stars catalog available TelegramStarsCatalogResponse
  • {
        "ok": true,
        "message": "string",
        "display_name": "string",
        "unit_price_usd": "$0.01",
        "min_custom_quantity": 49,
        "allows_custom_quantity": true,
        "unit_price_credits": 1,
        "preset_quantities": [
            50,
            75,
            100,
            150,
            250,
            350,
            500,
            750,
            1000,
            1500,
            2500,
            5000
        ],
        "packs": [
            {
                "quantity": 1,
                "price_credits": 1,
                "price_usd_display": "$5.00"
            }
        ]
    }
  • 503 Stars checkout disabled (no admin pricing) TelegramStarsCatalogResponse
  • {
        "ok": true,
        "message": "string",
        "display_name": "string",
        "unit_price_usd": "$0.01",
        "min_custom_quantity": 49,
        "allows_custom_quantity": true,
        "unit_price_credits": 1,
        "preset_quantities": [
            50,
            75,
            100,
            150,
            250,
            350,
            500,
            750,
            1000,
            1500,
            2500,
            5000
        ],
        "packs": [
            {
                "quantity": 1,
                "price_credits": 1,
                "price_usd_display": "$5.00"
            }
        ]
    }

Example cURL

curl -sS -X GET "https://www.gramnumber.com/api/v1/catalog/telegram/stars" \
  -H "Accept: application/json"
GET /api/v1/catalog/telegram/premium Public

Telegram Premium plans and pricing

Responses

  • 200 Premium plans available TelegramPremiumCatalogResponse
  • {
        "ok": true,
        "message": "string",
        "plans": [
            {
                "months": 1,
                "price_credits": 1,
                "price_usd": 1,
                "price_usd_display": "string",
                "wallet_price_display": "string"
            }
        ]
    }
  • 503 Premium checkout disabled TelegramPremiumCatalogResponse
  • {
        "ok": true,
        "message": "string",
        "plans": [
            {
                "months": 1,
                "price_credits": 1,
                "price_usd": 1,
                "price_usd_display": "string",
                "wallet_price_display": "string"
            }
        ]
    }

Example cURL

curl -sS -X GET "https://www.gramnumber.com/api/v1/catalog/telegram/premium" \
  -H "Accept: application/json"
GET /api/v1/catalog/telegram/gifts/collections Public

Telegram Gift collections

Responses

  • 200 Collections list TelegramGiftCollectionsResponse
  • {
        "ok": true,
        "message": "string",
        "purchase_available": true,
        "collections": [
            {
                "id": "string",
                "name": "string",
                "count": 1,
                "image_url": "string",
                "url": "string"
            }
        ]
    }
  • 503 Gifts catalog unavailable TelegramGiftCollectionsResponse
  • {
        "ok": true,
        "message": "string",
        "purchase_available": true,
        "collections": [
            {
                "id": "string",
                "name": "string",
                "count": 1,
                "image_url": "string",
                "url": "string"
            }
        ]
    }

Example cURL

curl -sS -X GET "https://www.gramnumber.com/api/v1/catalog/telegram/gifts/collections" \
  -H "Accept: application/json"
GET /api/v1/catalog/telegram/gifts Public

List gifts in a collection (on sale)

Parameters

Name In Type Required Description
collection_id query string Yes —
sort query string No —

Responses

  • 200 Gift listings with wallet prices (includes ~10% site markup) TelegramGiftsCatalogResponse
  • {
        "ok": true,
        "collection_id": "string",
        "sort": "string",
        "count": 1,
        "purchase_available": true,
        "gifts": [
            {
                "gift_slug": "string",
                "name": "string",
                "number": "string",
                "price_ton": 1,
                "price_usd_est": 1,
                "wallet_price": "string",
                "price_credits": 1,
                "image_url": "string",
                "for_sale": true
            }
        ]
    }
  • 422 Missing or invalid collection_id
  • 503 Gifts catalog unavailable

Example cURL

curl -sS -X GET "https://www.gramnumber.com/api/v1/catalog/telegram/gifts" \
  -H "Accept: application/json"
POST /api/v1/catalog/telegram/gifts/quote Public

Live gift quote (supplier price + markup)

Returns live USD/credits for a gift_slug (e.g. plushpepe-123). No wallet debit. Use before POST /api/v1/telegram/gifts. If purchase returns 202, re-check price via order payment status — supplier price can rise while awaiting top-up.

Request body TelegramGiftQuoteRequest

{
    "gift_slug": "plushpepe-42"
}

Responses

  • 200 Quote OK and for sale TelegramGiftQuoteResponse
  • {
        "ok": true,
        "gift_slug": "string",
        "for_sale": true,
        "sell_price_ton": 1,
        "sell_price_usd": 1,
        "price_usd": 1,
        "price_credits": 1,
        "wallet_price": "string",
        "message": "string"
    }
  • 422 Invalid slug, sold out, or price unavailable TelegramGiftQuoteResponse
  • {
        "ok": true,
        "gift_slug": "string",
        "for_sale": true,
        "sell_price_ton": 1,
        "sell_price_usd": 1,
        "price_usd": 1,
        "price_credits": 1,
        "wallet_price": "string",
        "message": "string"
    }

Example cURL

curl -sS -X POST "https://www.gramnumber.com/api/v1/catalog/telegram/gifts/quote" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "gift_slug": "plushpepe-42"
}'
POST /api/v1/telegram/stars Bearer token

Buy Telegram Stars (wallet debit)

Debits the token owner's wallet and creates a manual-fulfillment order. user_tag accepts @username or https://t.me/username. quantity must be a preset pack size from the Stars catalog, or any custom amount from 50 upward.

Request body TelegramStarsPurchaseRequest

{
    "user_tag": "@mychannel",
    "quantity": 100
}

Responses

  • 201 Order created TelegramPurchaseSuccess
  • {
        "ok": true,
        "order": {
            "id": 1,
            "order_number": "string",
            "product_type": "stars",
            "status": "completed",
            "status_label": "string",
            "quantity": 1,
            "months": 1,
            "gift_slug": "string",
            "gift_image_url": "string",
            "show_sender": true,
            "supplier_tx_id": "string",
            "user_tag": "string",
            "service_name_snapshot": "string",
            "price_charged_credits": 1,
            "quoted_price_credits": 1,
            "price_usd_display": "$4.99",
            "wallet_debited": true,
            "awaiting_payment": true,
            "remaining_credits": 1,
            "remaining_usd_display": "$1.25",
            "can_complete": true,
            "placed_via_api": true,
            "created_at": "string"
        },
        "staff_notified": true
    }
  • 401 Response Unauthorized
  • {
        "message": "Invalid API token."
    }
  • 402 Insufficient wallet balance TelegramPurchaseFailure
  • {
        "ok": false,
        "error": "insufficient_balance",
        "message": "string",
        "wallet": true,
        "order": {
            "id": 1,
            "order_number": "string",
            "product_type": "stars",
            "status": "completed",
            "status_label": "string",
            "quantity": 1,
            "months": 1,
            "gift_slug": "string",
            "gift_image_url": "string",
            "show_sender": true,
            "supplier_tx_id": "string",
            "user_tag": "string",
            "service_name_snapshot": "string",
            "price_charged_credits": 1,
            "quoted_price_credits": 1,
            "price_usd_display": "$4.99",
            "wallet_debited": true,
            "awaiting_payment": true,
            "remaining_credits": 1,
            "remaining_usd_display": "$1.25",
            "can_complete": true,
            "placed_via_api": true,
            "created_at": "string"
        },
        "errors": {}
    }
  • 422 Validation or invalid tag TelegramPurchaseFailure
  • {
        "ok": false,
        "error": "insufficient_balance",
        "message": "string",
        "wallet": true,
        "order": {
            "id": 1,
            "order_number": "string",
            "product_type": "stars",
            "status": "completed",
            "status_label": "string",
            "quantity": 1,
            "months": 1,
            "gift_slug": "string",
            "gift_image_url": "string",
            "show_sender": true,
            "supplier_tx_id": "string",
            "user_tag": "string",
            "service_name_snapshot": "string",
            "price_charged_credits": 1,
            "quoted_price_credits": 1,
            "price_usd_display": "$4.99",
            "wallet_debited": true,
            "awaiting_payment": true,
            "remaining_credits": 1,
            "remaining_usd_display": "$1.25",
            "can_complete": true,
            "placed_via_api": true,
            "created_at": "string"
        },
        "errors": {}
    }
  • 503 Stars checkout disabled TelegramPurchaseFailure
  • {
        "ok": false,
        "error": "insufficient_balance",
        "message": "string",
        "wallet": true,
        "order": {
            "id": 1,
            "order_number": "string",
            "product_type": "stars",
            "status": "completed",
            "status_label": "string",
            "quantity": 1,
            "months": 1,
            "gift_slug": "string",
            "gift_image_url": "string",
            "show_sender": true,
            "supplier_tx_id": "string",
            "user_tag": "string",
            "service_name_snapshot": "string",
            "price_charged_credits": 1,
            "quoted_price_credits": 1,
            "price_usd_display": "$4.99",
            "wallet_debited": true,
            "awaiting_payment": true,
            "remaining_credits": 1,
            "remaining_usd_display": "$1.25",
            "can_complete": true,
            "placed_via_api": true,
            "created_at": "string"
        },
        "errors": {}
    }

Example cURL

curl -sS -X POST "https://www.gramnumber.com/api/v1/telegram/stars" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer gn_<your_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "user_tag": "@mychannel",
    "quantity": 100
}'
POST /api/v1/telegram/premium Bearer token

Buy Telegram Premium months (wallet debit)

Debits the token owner's wallet and creates a manual-fulfillment order. months must match an available plan from the Premium catalog endpoint.

Request body TelegramPremiumPurchaseRequest

{
    "user_tag": "https://t.me/username",
    "months": 3
}

Responses

  • 201 Order created TelegramPurchaseSuccess
  • {
        "ok": true,
        "order": {
            "id": 1,
            "order_number": "string",
            "product_type": "stars",
            "status": "completed",
            "status_label": "string",
            "quantity": 1,
            "months": 1,
            "gift_slug": "string",
            "gift_image_url": "string",
            "show_sender": true,
            "supplier_tx_id": "string",
            "user_tag": "string",
            "service_name_snapshot": "string",
            "price_charged_credits": 1,
            "quoted_price_credits": 1,
            "price_usd_display": "$4.99",
            "wallet_debited": true,
            "awaiting_payment": true,
            "remaining_credits": 1,
            "remaining_usd_display": "$1.25",
            "can_complete": true,
            "placed_via_api": true,
            "created_at": "string"
        },
        "staff_notified": true
    }
  • 401 Response Unauthorized
  • {
        "message": "Invalid API token."
    }
  • 402 Insufficient wallet balance TelegramPurchaseFailure
  • {
        "ok": false,
        "error": "insufficient_balance",
        "message": "string",
        "wallet": true,
        "order": {
            "id": 1,
            "order_number": "string",
            "product_type": "stars",
            "status": "completed",
            "status_label": "string",
            "quantity": 1,
            "months": 1,
            "gift_slug": "string",
            "gift_image_url": "string",
            "show_sender": true,
            "supplier_tx_id": "string",
            "user_tag": "string",
            "service_name_snapshot": "string",
            "price_charged_credits": 1,
            "quoted_price_credits": 1,
            "price_usd_display": "$4.99",
            "wallet_debited": true,
            "awaiting_payment": true,
            "remaining_credits": 1,
            "remaining_usd_display": "$1.25",
            "can_complete": true,
            "placed_via_api": true,
            "created_at": "string"
        },
        "errors": {}
    }
  • 422 Validation or invalid tag / plan TelegramPurchaseFailure
  • {
        "ok": false,
        "error": "insufficient_balance",
        "message": "string",
        "wallet": true,
        "order": {
            "id": 1,
            "order_number": "string",
            "product_type": "stars",
            "status": "completed",
            "status_label": "string",
            "quantity": 1,
            "months": 1,
            "gift_slug": "string",
            "gift_image_url": "string",
            "show_sender": true,
            "supplier_tx_id": "string",
            "user_tag": "string",
            "service_name_snapshot": "string",
            "price_charged_credits": 1,
            "quoted_price_credits": 1,
            "price_usd_display": "$4.99",
            "wallet_debited": true,
            "awaiting_payment": true,
            "remaining_credits": 1,
            "remaining_usd_display": "$1.25",
            "can_complete": true,
            "placed_via_api": true,
            "created_at": "string"
        },
        "errors": {}
    }
  • 503 Premium checkout disabled TelegramPurchaseFailure
  • {
        "ok": false,
        "error": "insufficient_balance",
        "message": "string",
        "wallet": true,
        "order": {
            "id": 1,
            "order_number": "string",
            "product_type": "stars",
            "status": "completed",
            "status_label": "string",
            "quantity": 1,
            "months": 1,
            "gift_slug": "string",
            "gift_image_url": "string",
            "show_sender": true,
            "supplier_tx_id": "string",
            "user_tag": "string",
            "service_name_snapshot": "string",
            "price_charged_credits": 1,
            "quoted_price_credits": 1,
            "price_usd_display": "$4.99",
            "wallet_debited": true,
            "awaiting_payment": true,
            "remaining_credits": 1,
            "remaining_usd_display": "$1.25",
            "can_complete": true,
            "placed_via_api": true,
            "created_at": "string"
        },
        "errors": {}
    }

Example cURL

curl -sS -X POST "https://www.gramnumber.com/api/v1/telegram/premium" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer gn_<your_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "user_tag": "https://t.me/username",
    "months": 3
}'
POST /api/v1/telegram/gifts Bearer token

Buy a Telegram Gift (instant or awaiting payment)

Quotes the live supplier price (with site markup), then either:

  • Enough balance → debits the wallet, pays the supplier, transfers the gift to user_tag (201).
  • Short balance → creates a gift order in pending without debiting (202, awaiting_payment: true) and returns a payment helper with remaining credits and URLs for status / Cryptomus top-up / complete.

Flow: list collections → list gifts → optional quote → purchase → (if 202) top up → complete. gift_slug looks like collection-number (e.g. plushpepe-42). user_tag accepts @username or https://t.me/username.

Request body TelegramGiftPurchaseRequest

{
    "gift_slug": "plushpepe-42",
    "user_tag": "@recipient",
    "show_sender": false,
    "gift_image_url": "string",
    "gift_display_name": "string"
}

Responses

  • 201 Gift purchased and transferred (`awaiting_payment` false) TelegramGiftPurchaseSuccess
  • {
        "ok": true,
        "awaiting_payment": false,
        "order": {
            "id": 1,
            "order_number": "string",
            "product_type": "stars",
            "status": "completed",
            "status_label": "string",
            "quantity": 1,
            "months": 1,
            "gift_slug": "string",
            "gift_image_url": "string",
            "show_sender": true,
            "supplier_tx_id": "string",
            "user_tag": "string",
            "service_name_snapshot": "string",
            "price_charged_credits": 1,
            "quoted_price_credits": 1,
            "price_usd_display": "$4.99",
            "wallet_debited": true,
            "awaiting_payment": true,
            "remaining_credits": 1,
            "remaining_usd_display": "$1.25",
            "can_complete": true,
            "placed_via_api": true,
            "created_at": "string"
        }
    }
  • 202 Order created and awaiting wallet top-up. No debit yet (`wallet_debited: false`). Use `payment.*` URLs, then `POST .../complete` after the balance covers `remaining_credits`. TelegramGiftAwaitingPaymentResponse
  • {
        "ok": true,
        "awaiting_payment": true,
        "order": {
            "id": 1,
            "order_number": "string",
            "product_type": "stars",
            "status": "completed",
            "status_label": "string",
            "quantity": 1,
            "months": 1,
            "gift_slug": "string",
            "gift_image_url": "string",
            "show_sender": true,
            "supplier_tx_id": "string",
            "user_tag": "string",
            "service_name_snapshot": "string",
            "price_charged_credits": 1,
            "quoted_price_credits": 1,
            "price_usd_display": "$4.99",
            "wallet_debited": true,
            "awaiting_payment": true,
            "remaining_credits": 1,
            "remaining_usd_display": "$1.25",
            "can_complete": true,
            "placed_via_api": true,
            "created_at": "string"
        },
        "payment": {
            "status": "pending",
            "status_label": "string",
            "remaining_credits": 1,
            "remaining_usd": 1,
            "remaining_usd_display": "$5.00",
            "balance_credits": 1,
            "balance_usd_display": "string",
            "can_complete": true,
            "payment_status_url": "https://example.com/api/v1/telegram/orders/12/payment",
            "create_topup_url": "https://example.com/api/v1/telegram/orders/12/payment",
            "complete_url": "https://example.com/api/v1/telegram/orders/12/complete"
        }
    }
  • 401 Response Unauthorized
  • {
        "message": "Invalid API token."
    }
  • 422 Validation, invalid tag, invalid gift, quote failed, or not for sale TelegramPurchaseFailure
  • {
        "ok": false,
        "error": "insufficient_balance",
        "message": "string",
        "wallet": true,
        "order": {
            "id": 1,
            "order_number": "string",
            "product_type": "stars",
            "status": "completed",
            "status_label": "string",
            "quantity": 1,
            "months": 1,
            "gift_slug": "string",
            "gift_image_url": "string",
            "show_sender": true,
            "supplier_tx_id": "string",
            "user_tag": "string",
            "service_name_snapshot": "string",
            "price_charged_credits": 1,
            "quoted_price_credits": 1,
            "price_usd_display": "$4.99",
            "wallet_debited": true,
            "awaiting_payment": true,
            "remaining_credits": 1,
            "remaining_usd_display": "$1.25",
            "can_complete": true,
            "placed_via_api": true,
            "created_at": "string"
        },
        "errors": {}
    }
  • 503 Gifts checkout disabled or supplier payment/transfer failed (wallet refunded on supplier failure after debit) TelegramPurchaseFailure
  • {
        "ok": false,
        "error": "insufficient_balance",
        "message": "string",
        "wallet": true,
        "order": {
            "id": 1,
            "order_number": "string",
            "product_type": "stars",
            "status": "completed",
            "status_label": "string",
            "quantity": 1,
            "months": 1,
            "gift_slug": "string",
            "gift_image_url": "string",
            "show_sender": true,
            "supplier_tx_id": "string",
            "user_tag": "string",
            "service_name_snapshot": "string",
            "price_charged_credits": 1,
            "quoted_price_credits": 1,
            "price_usd_display": "$4.99",
            "wallet_debited": true,
            "awaiting_payment": true,
            "remaining_credits": 1,
            "remaining_usd_display": "$1.25",
            "can_complete": true,
            "placed_via_api": true,
            "created_at": "string"
        },
        "errors": {}
    }

Example cURL

curl -sS -X POST "https://www.gramnumber.com/api/v1/telegram/gifts" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer gn_<your_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "gift_slug": "plushpepe-42",
    "user_tag": "@recipient",
    "show_sender": false,
    "gift_image_url": "string",
    "gift_display_name": "string"
}'
GET /api/v1/telegram/orders Bearer token

List Telegram Stars / Premium / Gift orders

Returns the most recent orders for the token owner. Optional limit query (1–100, default 50).

Parameters

Name In Type Required Description
limit query integer No —

Responses

  • 200 Order list TelegramOrdersListResponse
  • {
        "ok": true,
        "orders": [
            {
                "id": 1,
                "order_number": "string",
                "product_type": "stars",
                "status": "completed",
                "status_label": "string",
                "quantity": 1,
                "months": 1,
                "gift_slug": "string",
                "gift_image_url": "string",
                "show_sender": true,
                "supplier_tx_id": "string",
                "user_tag": "string",
                "service_name_snapshot": "string",
                "price_charged_credits": 1,
                "quoted_price_credits": 1,
                "price_usd_display": "$4.99",
                "wallet_debited": true,
                "awaiting_payment": true,
                "remaining_credits": 1,
                "remaining_usd_display": "$1.25",
                "can_complete": true,
                "placed_via_api": true,
                "created_at": "string"
            }
        ]
    }
  • 401 Response Unauthorized
  • {
        "message": "Invalid API token."
    }

Example cURL

curl -sS -X GET "https://www.gramnumber.com/api/v1/telegram/orders" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer gn_<your_token>"
GET /api/v1/telegram/orders/{telegramProductOrder} Bearer token

Get one Telegram Stars / Premium / Gift order

For gift orders awaiting payment, the live supplier quote is refreshed when possible. A price increase may move status from pending to not_enough and raise remaining_credits.

Parameters

Name In Type Required Description
telegramProductOrder path integer Yes —

Responses

  • 200 Response
  • {
        "ok": true,
        "order": {
            "id": 1,
            "order_number": "string",
            "product_type": "stars",
            "status": "completed",
            "status_label": "string",
            "quantity": 1,
            "months": 1,
            "gift_slug": "string",
            "gift_image_url": "string",
            "show_sender": true,
            "supplier_tx_id": "string",
            "user_tag": "string",
            "service_name_snapshot": "string",
            "price_charged_credits": 1,
            "quoted_price_credits": 1,
            "price_usd_display": "$4.99",
            "wallet_debited": true,
            "awaiting_payment": true,
            "remaining_credits": 1,
            "remaining_usd_display": "$1.25",
            "can_complete": true,
            "placed_via_api": true,
            "created_at": "string"
        }
    }
  • 401 Response Unauthorized
  • {
        "message": "Invalid API token."
    }
  • 404 Not found or not owned by this user

Example cURL

curl -sS -X GET "https://www.gramnumber.com/api/v1/telegram/orders/{telegramProductOrder}" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer gn_<your_token>"
GET /api/v1/telegram/orders/{telegramProductOrder}/payment Bearer token

Gift payment status (remaining balance)

Gift orders only. Refreshes the live quote while pending / not_enough, then returns remaining credits vs the token owner's wallet and whether POST .../complete can run.

Parameters

Name In Type Required Description
telegramProductOrder path integer Yes —

Responses

  • 200 Payment snapshot TelegramGiftPaymentStatusResponse
  • {
        "ok": true,
        "awaiting_payment": true,
        "can_complete": true,
        "cryptomus_configured": true,
        "status": "pending",
        "status_label": "string",
        "price_credits": 1,
        "price_usd_display": "string",
        "balance_credits": 1,
        "balance_usd_display": "string",
        "remaining_credits": 1,
        "remaining_usd": 1,
        "remaining_usd_display": "string",
        "order": {
            "id": 1,
            "order_number": "string",
            "product_type": "stars",
            "status": "completed",
            "status_label": "string",
            "quantity": 1,
            "months": 1,
            "gift_slug": "string",
            "gift_image_url": "string",
            "show_sender": true,
            "supplier_tx_id": "string",
            "user_tag": "string",
            "service_name_snapshot": "string",
            "price_charged_credits": 1,
            "quoted_price_credits": 1,
            "price_usd_display": "$4.99",
            "wallet_debited": true,
            "awaiting_payment": true,
            "remaining_credits": 1,
            "remaining_usd_display": "$1.25",
            "can_complete": true,
            "placed_via_api": true,
            "created_at": "string"
        }
    }
  • 401 Response Unauthorized
  • {
        "message": "Invalid API token."
    }
  • 404 Not found or not owned by this user
  • 422 Order is not a gift TelegramPurchaseFailure
  • {
        "ok": false,
        "error": "insufficient_balance",
        "message": "string",
        "wallet": true,
        "order": {
            "id": 1,
            "order_number": "string",
            "product_type": "stars",
            "status": "completed",
            "status_label": "string",
            "quantity": 1,
            "months": 1,
            "gift_slug": "string",
            "gift_image_url": "string",
            "show_sender": true,
            "supplier_tx_id": "string",
            "user_tag": "string",
            "service_name_snapshot": "string",
            "price_charged_credits": 1,
            "quoted_price_credits": 1,
            "price_usd_display": "$4.99",
            "wallet_debited": true,
            "awaiting_payment": true,
            "remaining_credits": 1,
            "remaining_usd_display": "$1.25",
            "can_complete": true,
            "placed_via_api": true,
            "created_at": "string"
        },
        "errors": {}
    }

Example cURL

curl -sS -X GET "https://www.gramnumber.com/api/v1/telegram/orders/{telegramProductOrder}/payment" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer gn_<your_token>"
POST /api/v1/telegram/orders/{telegramProductOrder}/payment Bearer token

Create Cryptomus top-up for a gift order

Creates a wallet top-up invoice sized to the remaining gift price (at least the site minimum top-up). Open pay_url to pay with crypto. After Cryptomus credits the wallet, call POST .../complete. If the wallet already covers the price, returns can_complete: true without creating an invoice.

Parameters

Name In Type Required Description
telegramProductOrder path integer Yes —

Responses

  • 200 Balance already enough — call complete TelegramGiftTopupReadyResponse
  • {
        "ok": true,
        "awaiting_payment": true,
        "can_complete": true,
        "message": "string",
        "order": {
            "id": 1,
            "order_number": "string",
            "product_type": "stars",
            "status": "completed",
            "status_label": "string",
            "quantity": 1,
            "months": 1,
            "gift_slug": "string",
            "gift_image_url": "string",
            "show_sender": true,
            "supplier_tx_id": "string",
            "user_tag": "string",
            "service_name_snapshot": "string",
            "price_charged_credits": 1,
            "quoted_price_credits": 1,
            "price_usd_display": "$4.99",
            "wallet_debited": true,
            "awaiting_payment": true,
            "remaining_credits": 1,
            "remaining_usd_display": "$1.25",
            "can_complete": true,
            "placed_via_api": true,
            "created_at": "string"
        }
    }
  • 201 Cryptomus invoice created TelegramGiftTopupCreatedResponse
  • {
        "ok": true,
        "awaiting_payment": true,
        "pay_url": "string",
        "topup_id": 1,
        "topup_reference": "string",
        "amount_credits": 1,
        "amount_usd": 1,
        "amount_usd_display": "string",
        "remaining_credits": 1,
        "remaining_usd_display": "string",
        "order": {
            "id": 1,
            "order_number": "string",
            "product_type": "stars",
            "status": "completed",
            "status_label": "string",
            "quantity": 1,
            "months": 1,
            "gift_slug": "string",
            "gift_image_url": "string",
            "show_sender": true,
            "supplier_tx_id": "string",
            "user_tag": "string",
            "service_name_snapshot": "string",
            "price_charged_credits": 1,
            "quoted_price_credits": 1,
            "price_usd_display": "$4.99",
            "wallet_debited": true,
            "awaiting_payment": true,
            "remaining_credits": 1,
            "remaining_usd_display": "$1.25",
            "can_complete": true,
            "placed_via_api": true,
            "created_at": "string"
        }
    }
  • 401 Response Unauthorized
  • {
        "message": "Invalid API token."
    }
  • 404 Not found or not owned by this user
  • 422 Order not awaiting payment, or amount invalid TelegramPurchaseFailure
  • {
        "ok": false,
        "error": "insufficient_balance",
        "message": "string",
        "wallet": true,
        "order": {
            "id": 1,
            "order_number": "string",
            "product_type": "stars",
            "status": "completed",
            "status_label": "string",
            "quantity": 1,
            "months": 1,
            "gift_slug": "string",
            "gift_image_url": "string",
            "show_sender": true,
            "supplier_tx_id": "string",
            "user_tag": "string",
            "service_name_snapshot": "string",
            "price_charged_credits": 1,
            "quoted_price_credits": 1,
            "price_usd_display": "$4.99",
            "wallet_debited": true,
            "awaiting_payment": true,
            "remaining_credits": 1,
            "remaining_usd_display": "$1.25",
            "can_complete": true,
            "placed_via_api": true,
            "created_at": "string"
        },
        "errors": {}
    }
  • 503 Cryptomus not configured or gateway error TelegramPurchaseFailure
  • {
        "ok": false,
        "error": "insufficient_balance",
        "message": "string",
        "wallet": true,
        "order": {
            "id": 1,
            "order_number": "string",
            "product_type": "stars",
            "status": "completed",
            "status_label": "string",
            "quantity": 1,
            "months": 1,
            "gift_slug": "string",
            "gift_image_url": "string",
            "show_sender": true,
            "supplier_tx_id": "string",
            "user_tag": "string",
            "service_name_snapshot": "string",
            "price_charged_credits": 1,
            "quoted_price_credits": 1,
            "price_usd_display": "$4.99",
            "wallet_debited": true,
            "awaiting_payment": true,
            "remaining_credits": 1,
            "remaining_usd_display": "$1.25",
            "can_complete": true,
            "placed_via_api": true,
            "created_at": "string"
        },
        "errors": {}
    }

Example cURL

curl -sS -X POST "https://www.gramnumber.com/api/v1/telegram/orders/{telegramProductOrder}/payment" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer gn_<your_token>"
POST /api/v1/telegram/orders/{telegramProductOrder}/complete Bearer token

Complete a gift order after top-up

For pending / not_enough gift orders when the wallet covers the current quoted price. Debits the wallet, pays the supplier, and transfers the gift. Returns 201 on success (same shape as an instant gift purchase). Returns 402 if balance is still short.

Parameters

Name In Type Required Description
telegramProductOrder path integer Yes —

Responses

  • 201 Gift purchased and transferred TelegramGiftPurchaseSuccess
  • {
        "ok": true,
        "awaiting_payment": false,
        "order": {
            "id": 1,
            "order_number": "string",
            "product_type": "stars",
            "status": "completed",
            "status_label": "string",
            "quantity": 1,
            "months": 1,
            "gift_slug": "string",
            "gift_image_url": "string",
            "show_sender": true,
            "supplier_tx_id": "string",
            "user_tag": "string",
            "service_name_snapshot": "string",
            "price_charged_credits": 1,
            "quoted_price_credits": 1,
            "price_usd_display": "$4.99",
            "wallet_debited": true,
            "awaiting_payment": true,
            "remaining_credits": 1,
            "remaining_usd_display": "$1.25",
            "can_complete": true,
            "placed_via_api": true,
            "created_at": "string"
        }
    }
  • 401 Response Unauthorized
  • {
        "message": "Invalid API token."
    }
  • 402 Wallet still insufficient after re-quote TelegramPurchaseFailure
  • {
        "ok": false,
        "error": "insufficient_balance",
        "message": "string",
        "wallet": true,
        "order": {
            "id": 1,
            "order_number": "string",
            "product_type": "stars",
            "status": "completed",
            "status_label": "string",
            "quantity": 1,
            "months": 1,
            "gift_slug": "string",
            "gift_image_url": "string",
            "show_sender": true,
            "supplier_tx_id": "string",
            "user_tag": "string",
            "service_name_snapshot": "string",
            "price_charged_credits": 1,
            "quoted_price_credits": 1,
            "price_usd_display": "$4.99",
            "wallet_debited": true,
            "awaiting_payment": true,
            "remaining_credits": 1,
            "remaining_usd_display": "$1.25",
            "can_complete": true,
            "placed_via_api": true,
            "created_at": "string"
        },
        "errors": {}
    }
  • 404 Not found or not owned by this user
  • 422 Not awaiting payment, invalid gift/tag, or invalid state TelegramPurchaseFailure
  • {
        "ok": false,
        "error": "insufficient_balance",
        "message": "string",
        "wallet": true,
        "order": {
            "id": 1,
            "order_number": "string",
            "product_type": "stars",
            "status": "completed",
            "status_label": "string",
            "quantity": 1,
            "months": 1,
            "gift_slug": "string",
            "gift_image_url": "string",
            "show_sender": true,
            "supplier_tx_id": "string",
            "user_tag": "string",
            "service_name_snapshot": "string",
            "price_charged_credits": 1,
            "quoted_price_credits": 1,
            "price_usd_display": "$4.99",
            "wallet_debited": true,
            "awaiting_payment": true,
            "remaining_credits": 1,
            "remaining_usd_display": "$1.25",
            "can_complete": true,
            "placed_via_api": true,
            "created_at": "string"
        },
        "errors": {}
    }
  • 503 Supplier payment/transfer failed (wallet refunded after debit) TelegramPurchaseFailure
  • {
        "ok": false,
        "error": "insufficient_balance",
        "message": "string",
        "wallet": true,
        "order": {
            "id": 1,
            "order_number": "string",
            "product_type": "stars",
            "status": "completed",
            "status_label": "string",
            "quantity": 1,
            "months": 1,
            "gift_slug": "string",
            "gift_image_url": "string",
            "show_sender": true,
            "supplier_tx_id": "string",
            "user_tag": "string",
            "service_name_snapshot": "string",
            "price_charged_credits": 1,
            "quoted_price_credits": 1,
            "price_usd_display": "$4.99",
            "wallet_debited": true,
            "awaiting_payment": true,
            "remaining_credits": 1,
            "remaining_usd_display": "$1.25",
            "can_complete": true,
            "placed_via_api": true,
            "created_at": "string"
        },
        "errors": {}
    }

Example cURL

curl -sS -X POST "https://www.gramnumber.com/api/v1/telegram/orders/{telegramProductOrder}/complete" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer gn_<your_token>"
POST /api/v1/telegram/orders/{telegramProductOrder}/cancel Bearer token

Cancel a Telegram product order

Allowed while status is pending, not_enough, or in_progress (same ownership rules as show). Gift orders awaiting payment typically have wallet_debited: false → status becomes cancelled with no refund. If the wallet was already debited, balance is restored and status becomes refunded.

Parameters

Name In Type Required Description
telegramProductOrder path integer Yes —

Responses

  • 200 Order cancelled or refunded
  • {
        "ok": true,
        "order": {
            "id": 1,
            "order_number": "string",
            "product_type": "stars",
            "status": "completed",
            "status_label": "string",
            "quantity": 1,
            "months": 1,
            "gift_slug": "string",
            "gift_image_url": "string",
            "show_sender": true,
            "supplier_tx_id": "string",
            "user_tag": "string",
            "service_name_snapshot": "string",
            "price_charged_credits": 1,
            "quoted_price_credits": 1,
            "price_usd_display": "$4.99",
            "wallet_debited": true,
            "awaiting_payment": true,
            "remaining_credits": 1,
            "remaining_usd_display": "$1.25",
            "can_complete": true,
            "placed_via_api": true,
            "created_at": "string"
        }
    }
  • 401 Response Unauthorized
  • {
        "message": "Invalid API token."
    }
  • 404 Not found or not owned by this user
  • 422 Cancel not allowed for this status TelegramPurchaseFailure
  • {
        "ok": false,
        "error": "insufficient_balance",
        "message": "string",
        "wallet": true,
        "order": {
            "id": 1,
            "order_number": "string",
            "product_type": "stars",
            "status": "completed",
            "status_label": "string",
            "quantity": 1,
            "months": 1,
            "gift_slug": "string",
            "gift_image_url": "string",
            "show_sender": true,
            "supplier_tx_id": "string",
            "user_tag": "string",
            "service_name_snapshot": "string",
            "price_charged_credits": 1,
            "quoted_price_credits": 1,
            "price_usd_display": "$4.99",
            "wallet_debited": true,
            "awaiting_payment": true,
            "remaining_credits": 1,
            "remaining_usd_display": "$1.25",
            "can_complete": true,
            "placed_via_api": true,
            "created_at": "string"
        },
        "errors": {}
    }

Example cURL

curl -sS -X POST "https://www.gramnumber.com/api/v1/telegram/orders/{telegramProductOrder}/cancel" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer gn_<your_token>"

SecureTD

SecureTD Telegram account catalog and wallet checkout

GET /api/v1/catalog/securetd/categories Public

SecureTD product categories

Responses

  • 200 Categories available SecureTdCategoriesCatalogResponse
  • {
        "ok": true,
        "message": "string",
        "categories": [
            {
                "category_id": 1,
                "category_name": "Telegram accounts",
                "total_stock": 1
            }
        ]
    }
  • 503 SecureTD checkout disabled or upstream unavailable SecureTdCategoriesCatalogResponse
  • {
        "ok": true,
        "message": "string",
        "categories": [
            {
                "category_id": 1,
                "category_name": "Telegram accounts",
                "total_stock": 1
            }
        ]
    }

Example cURL

curl -sS -X GET "https://www.gramnumber.com/api/v1/catalog/securetd/categories" \
  -H "Accept: application/json"
GET /api/v1/catalog/securetd/categories/{categoryId}/products Public

SecureTD products in one category

Parameters

Name In Type Required Description
categoryId path integer Yes —

Responses

  • 200 Product list for category SecureTdProductsCatalogResponse
  • {
        "ok": true,
        "category_id": 1,
        "products": [
            {
                "product_id": 1,
                "product_name": "USA +1",
                "total_stock": 1,
                "supplier_price_usd": 1,
                "retail_price_usd": 1,
                "wallet_price": "$2.50",
                "wallet_unit_price": "$2.50",
                "category_id": 1,
                "category_name": "string"
            }
        ]
    }
  • 503 SecureTD checkout disabled SecureTdProductsCatalogResponse
  • {
        "ok": true,
        "category_id": 1,
        "products": [
            {
                "product_id": 1,
                "product_name": "USA +1",
                "total_stock": 1,
                "supplier_price_usd": 1,
                "retail_price_usd": 1,
                "wallet_price": "$2.50",
                "wallet_unit_price": "$2.50",
                "category_id": 1,
                "category_name": "string"
            }
        ]
    }

Example cURL

curl -sS -X GET "https://www.gramnumber.com/api/v1/catalog/securetd/categories/{categoryId}/products" \
  -H "Accept: application/json"
GET /api/v1/catalog/securetd/search Public

Search SecureTD products by country name or dial code

Matches product names across all categories. Query must be at least 2 characters.

Parameters

Name In Type Required Description
q query string No Country name or dial code (e.g. `+1`, `USA`, `Germany`)

Responses

  • 200 Search results (empty when query is blank or too short) SecureTdSearchResponse
  • {
        "ok": true,
        "query": "string",
        "products": [
            {
                "product_id": 1,
                "product_name": "USA +1",
                "total_stock": 1,
                "supplier_price_usd": 1,
                "retail_price_usd": 1,
                "wallet_price": "$2.50",
                "wallet_unit_price": "$2.50",
                "category_id": 1,
                "category_name": "string"
            }
        ]
    }
  • 503 SecureTD checkout disabled SecureTdSearchResponse
  • {
        "ok": true,
        "query": "string",
        "products": [
            {
                "product_id": 1,
                "product_name": "USA +1",
                "total_stock": 1,
                "supplier_price_usd": 1,
                "retail_price_usd": 1,
                "wallet_price": "$2.50",
                "wallet_unit_price": "$2.50",
                "category_id": 1,
                "category_name": "string"
            }
        ]
    }

Example cURL

curl -sS -X GET "https://www.gramnumber.com/api/v1/catalog/securetd/search" \
  -H "Accept: application/json"
POST /api/v1/securetd/checkout Bearer token

Buy SecureTD Telegram account(s) (wallet debit)

Debits the token owner's wallet and submits a supplier purchase task. Poll GET /api/v1/securetd/orders/{id} until download_ready is true, then download via GET /api/v1/securetd/orders/{id}/download.

Request body SecureTdCheckoutRequest

{
    "product_id": 12345,
    "quantity": 1
}

Responses

  • 201 Order created and supplier task started SecureTdCheckoutSuccess
  • {
        "ok": true,
        "order": {
            "id": 1,
            "order_number": "GN-10042",
            "status": "processing",
            "product_id": 1,
            "product_name": "string",
            "category_id": 1,
            "quantity": 1,
            "price_charged_credits": 1,
            "price_usd_display": "$4.99",
            "task_id": "string",
            "task_status": 1,
            "file_url": "string",
            "download_ready": true,
            "download_url": "string",
            "created_at": "string"
        }
    }
  • 401 Response Unauthorized
  • {
        "message": "Invalid API token."
    }
  • 402 Insufficient wallet balance SecureTdCheckoutFailure
  • {
        "ok": false,
        "error": "insufficient_balance",
        "message": "string",
        "wallet": true,
        "errors": {}
    }
  • 422 Validation, invalid product, out of stock, or supplier error SecureTdCheckoutFailure
  • {
        "ok": false,
        "error": "insufficient_balance",
        "message": "string",
        "wallet": true,
        "errors": {}
    }
  • 503 SecureTD checkout disabled SecureTdCheckoutFailure
  • {
        "ok": false,
        "error": "insufficient_balance",
        "message": "string",
        "wallet": true,
        "errors": {}
    }

Example cURL

curl -sS -X POST "https://www.gramnumber.com/api/v1/securetd/checkout" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer gn_<your_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "product_id": 12345,
    "quantity": 1
}'
GET /api/v1/securetd/orders Bearer token

List SecureTD orders

Returns the most recent orders for the token owner. Optional limit query (1–100, default 50).

Parameters

Name In Type Required Description
limit query integer No —

Responses

  • 200 Order list SecureTdOrdersListResponse
  • {
        "ok": true,
        "orders": [
            {
                "id": 1,
                "order_number": "GN-10042",
                "status": "processing",
                "product_id": 1,
                "product_name": "string",
                "category_id": 1,
                "quantity": 1,
                "price_charged_credits": 1,
                "price_usd_display": "$4.99",
                "task_id": "string",
                "task_status": 1,
                "file_url": "string",
                "download_ready": true,
                "download_url": "string",
                "created_at": "string"
            }
        ]
    }
  • 401 Response Unauthorized
  • {
        "message": "Invalid API token."
    }

Example cURL

curl -sS -X GET "https://www.gramnumber.com/api/v1/securetd/orders" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer gn_<your_token>"
GET /api/v1/securetd/orders/{secureTdOrder} Bearer token

Get one SecureTD order

Syncs supplier task status when the order is still processing.

Parameters

Name In Type Required Description
secureTdOrder path integer Yes —

Responses

  • 200 Response
  • {
        "ok": true,
        "order": {
            "id": 1,
            "order_number": "GN-10042",
            "status": "processing",
            "product_id": 1,
            "product_name": "string",
            "category_id": 1,
            "quantity": 1,
            "price_charged_credits": 1,
            "price_usd_display": "$4.99",
            "task_id": "string",
            "task_status": 1,
            "file_url": "string",
            "download_ready": true,
            "download_url": "string",
            "created_at": "string"
        }
    }
  • 401 Response Unauthorized
  • {
        "message": "Invalid API token."
    }
  • 404 Not found or not owned by this user

Example cURL

curl -sS -X GET "https://www.gramnumber.com/api/v1/securetd/orders/{secureTdOrder}" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer gn_<your_token>"
GET /api/v1/securetd/orders/{secureTdOrder}/download Bearer token

Download completed SecureTD account file

Streams the supplier file with a GramNumber filename (GramNumber - {product} - {quantity}.{ext}). Requires Bearer auth; only the order owner can download.

Parameters

Name In Type Required Description
secureTdOrder path integer Yes —

Responses

  • 200 File attachment
  • 401 Response Unauthorized
  • {
        "message": "Invalid API token."
    }
  • 404 Not found, not owned, or file not ready
  • 502 Supplier file could not be fetched

Example cURL

curl -sS -X GET "https://www.gramnumber.com/api/v1/securetd/orders/{secureTdOrder}/download" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer gn_<your_token>"

Custom Tdata

Custom Tdata Telegram account files — separate folder catalog, checkout, and downloads (not SecureTD)

GET /api/v1/catalog/custom-tdata/categories Public

Custom Tdata product categories

Same response shape as SecureTD categories (region list with stock).

Responses

  • 200 Categories available SecureTdCategoriesCatalogResponse
  • {
        "ok": true,
        "message": "string",
        "categories": [
            {
                "category_id": 1,
                "category_name": "Telegram accounts",
                "total_stock": 1
            }
        ]
    }
  • 503 Custom Tdata disabled or upstream unavailable SecureTdCategoriesCatalogResponse
  • {
        "ok": true,
        "message": "string",
        "categories": [
            {
                "category_id": 1,
                "category_name": "Telegram accounts",
                "total_stock": 1
            }
        ]
    }

Example cURL

curl -sS -X GET "https://www.gramnumber.com/api/v1/catalog/custom-tdata/categories" \
  -H "Accept: application/json"
GET /api/v1/catalog/custom-tdata/categories/{categoryId}/products Public

Custom Tdata products in one category

Same response shape as SecureTD category products.

Parameters

Name In Type Required Description
categoryId path integer Yes —

Responses

  • 200 Product list for category SecureTdProductsCatalogResponse
  • {
        "ok": true,
        "category_id": 1,
        "products": [
            {
                "product_id": 1,
                "product_name": "USA +1",
                "total_stock": 1,
                "supplier_price_usd": 1,
                "retail_price_usd": 1,
                "wallet_price": "$2.50",
                "wallet_unit_price": "$2.50",
                "category_id": 1,
                "category_name": "string"
            }
        ]
    }
  • 503 Custom Tdata disabled SecureTdProductsCatalogResponse
  • {
        "ok": true,
        "category_id": 1,
        "products": [
            {
                "product_id": 1,
                "product_name": "USA +1",
                "total_stock": 1,
                "supplier_price_usd": 1,
                "retail_price_usd": 1,
                "wallet_price": "$2.50",
                "wallet_unit_price": "$2.50",
                "category_id": 1,
                "category_name": "string"
            }
        ]
    }

Example cURL

curl -sS -X GET "https://www.gramnumber.com/api/v1/catalog/custom-tdata/categories/{categoryId}/products" \
  -H "Accept: application/json"
GET /api/v1/catalog/custom-tdata/search Public

Search Custom Tdata offers

Matches product names across all categories. Query must be at least 2 characters (same as SecureTD search).

Parameters

Name In Type Required Description
q query string No Country name or dial code

Responses

  • 200 Search results (empty when query is blank or too short) SecureTdSearchResponse
  • {
        "ok": true,
        "query": "string",
        "products": [
            {
                "product_id": 1,
                "product_name": "USA +1",
                "total_stock": 1,
                "supplier_price_usd": 1,
                "retail_price_usd": 1,
                "wallet_price": "$2.50",
                "wallet_unit_price": "$2.50",
                "category_id": 1,
                "category_name": "string"
            }
        ]
    }
  • 503 Custom Tdata disabled ErrorResponse
  • {
        "ok": false,
        "message": "string"
    }

Example cURL

curl -sS -X GET "https://www.gramnumber.com/api/v1/catalog/custom-tdata/search" \
  -H "Accept: application/json"
POST /api/v1/custom-tdata/checkout Bearer token

Buy Custom Tdata account file(s) (wallet debit)

Separate from POST /api/v1/securetd/checkout. Debits the token owner's wallet and places a supplier order. Poll GET /api/v1/custom-tdata/orders/{id} until download_ready is true, then GET /api/v1/custom-tdata/orders/{id}/download.

Request body CustomTdataCheckoutRequest

{
    "product_id": 1,
    "quantity": 1
}

Responses

  • 201 Order created CustomTdataCheckoutSuccess
  • {
        "ok": true,
        "order": {
            "id": 1,
            "order_number": "GN-10042",
            "status": "processing",
            "product_id": 1,
            "product_name": "string",
            "category_id": 1,
            "quantity": 1,
            "price_charged_credits": 1,
            "price_usd_display": "$4.99",
            "download_ready": true,
            "download_url": "string",
            "download_filename": "string",
            "created_at": "string"
        }
    }
  • 401 Response Unauthorized
  • {
        "message": "Invalid API token."
    }
  • 402 Insufficient wallet balance CustomTdataCheckoutFailure
  • {
        "ok": false,
        "error": "string",
        "message": "string"
    }
  • 422 Response CustomTdataCheckoutFailure
  • {
        "ok": false,
        "error": "string",
        "message": "string"
    }
  • 503 Custom Tdata checkout disabled

Example cURL

curl -sS -X POST "https://www.gramnumber.com/api/v1/custom-tdata/checkout" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer gn_<your_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "product_id": 1,
    "quantity": 1
}'
GET /api/v1/custom-tdata/orders Bearer token

List Custom Tdata orders

Parameters

Name In Type Required Description
limit query integer No —

Responses

  • 200 Response CustomTdataOrdersListResponse
  • {
        "ok": true,
        "orders": [
            {
                "id": 1,
                "order_number": "GN-10042",
                "status": "processing",
                "product_id": 1,
                "product_name": "string",
                "category_id": 1,
                "quantity": 1,
                "price_charged_credits": 1,
                "price_usd_display": "$4.99",
                "download_ready": true,
                "download_url": "string",
                "download_filename": "string",
                "created_at": "string"
            }
        ]
    }
  • 401 Response Unauthorized
  • {
        "message": "Invalid API token."
    }

Example cURL

curl -sS -X GET "https://www.gramnumber.com/api/v1/custom-tdata/orders" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer gn_<your_token>"
GET /api/v1/custom-tdata/orders/{customTdataOrder} Bearer token

Get one Custom Tdata order

Syncs supplier status while the order is still processing.

Parameters

Name In Type Required Description
customTdataOrder path integer Yes —

Responses

  • 200 Response
  • {
        "ok": true,
        "order": {
            "id": 1,
            "order_number": "GN-10042",
            "status": "processing",
            "product_id": 1,
            "product_name": "string",
            "category_id": 1,
            "quantity": 1,
            "price_charged_credits": 1,
            "price_usd_display": "$4.99",
            "download_ready": true,
            "download_url": "string",
            "download_filename": "string",
            "created_at": "string"
        }
    }
  • 401 Response Unauthorized
  • {
        "message": "Invalid API token."
    }
  • 404 Not found or not owned by this user

Example cURL

curl -sS -X GET "https://www.gramnumber.com/api/v1/custom-tdata/orders/{customTdataOrder}" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer gn_<your_token>"
GET /api/v1/custom-tdata/orders/{customTdataOrder}/download Bearer token

Download completed Custom Tdata archive

Parameters

Name In Type Required Description
customTdataOrder path integer Yes —

Responses

  • 200 ZIP stream
  • 401 Response Unauthorized
  • {
        "message": "Invalid API token."
    }
  • 404 Not found, not owned, or file not ready

Example cURL

curl -sS -X GET "https://www.gramnumber.com/api/v1/custom-tdata/orders/{customTdataOrder}/download" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer gn_<your_token>"

GiftCards

Gift card catalog and wallet checkout

GET /api/v1/catalog/gift-cards/categories Public

List gift card categories

Responses

  • 200 Categories available GiftCardCategoriesResponse
  • {
        "ok": true,
        "message": "string",
        "markup_percent": 1,
        "categories": [
            {
                "category_id": "string",
                "name": "string",
                "note": "string",
                "image_url": "string",
                "slug": "string"
            }
        ]
    }
  • 503 Gift cards catalog unavailable GiftCardCategoriesResponse
  • {
        "ok": true,
        "message": "string",
        "markup_percent": 1,
        "categories": [
            {
                "category_id": "string",
                "name": "string",
                "note": "string",
                "image_url": "string",
                "slug": "string"
            }
        ]
    }

Example cURL

curl -sS -X GET "https://www.gramnumber.com/api/v1/catalog/gift-cards/categories" \
  -H "Accept: application/json"
GET /api/v1/catalog/gift-cards/categories/{categoryId} Public

Gift card offers in one category

Parameters

Name In Type Required Description
categoryId path string Yes —

Responses

  • 200 Category with offers GiftCardCategoryResponse
  • {
        "ok": true,
        "category": {
            "category_id": "string",
            "name": "string",
            "note": "string",
            "image_url": "string",
            "offers": [
                {
                    "card_id": "string",
                    "name": "string",
                    "retail_price_usd": 1,
                    "price_credits": 1,
                    "wallet_price": "string",
                    "stock": 1,
                    "min_qty": 1,
                    "max_qty": 1
                }
            ]
        }
    }
  • 404 Category not found
  • 503 Gift cards catalog unavailable

Example cURL

curl -sS -X GET "https://www.gramnumber.com/api/v1/catalog/gift-cards/categories/{categoryId}" \
  -H "Accept: application/json"
POST /api/v1/gift-cards/checkout Bearer token

Buy a gift card (wallet debit)

Debits the token owner's wallet and fulfills via the gift-card supplier. If balance is short, returns 202 with awaiting_payment: true (no debit yet).

Request body GiftCardCheckoutRequest

{
    "category_id": "steam-us",
    "card_id": "steam-10",
    "quantity": 1
}

Responses

  • 201 Paid / fulfilling GiftCardCheckoutResponse
  • {
        "ok": true,
        "awaiting_payment": true,
        "order": {
            "id": 1,
            "order_number": "string",
            "product_kind": "gift_card",
            "status": "completed",
            "status_label": "string",
            "category_id": "string",
            "card_id": "string",
            "product_name": "string",
            "product_image_url": "string",
            "quantity": 1,
            "price_charged_credits": 1,
            "price_usd_display": "string",
            "wallet_debited": true,
            "awaiting_payment": true,
            "remaining_credits": 1,
            "remaining_usd_display": "string",
            "codes": [
                "string"
            ],
            "placed_via_api": true,
            "created_at": "string"
        },
        "payment": {}
    }
  • 202 Awaiting wallet top-up GiftCardCheckoutResponse
  • {
        "ok": true,
        "awaiting_payment": true,
        "order": {
            "id": 1,
            "order_number": "string",
            "product_kind": "gift_card",
            "status": "completed",
            "status_label": "string",
            "category_id": "string",
            "card_id": "string",
            "product_name": "string",
            "product_image_url": "string",
            "quantity": 1,
            "price_charged_credits": 1,
            "price_usd_display": "string",
            "wallet_debited": true,
            "awaiting_payment": true,
            "remaining_credits": 1,
            "remaining_usd_display": "string",
            "codes": [
                "string"
            ],
            "placed_via_api": true,
            "created_at": "string"
        },
        "payment": {}
    }
  • 401 Response Unauthorized
  • {
        "message": "Invalid API token."
    }
  • 402 Insufficient balance (hard fail paths)
  • 422 Validation / invalid offer / out of stock
  • 503 Gift cards unavailable

Example cURL

curl -sS -X POST "https://www.gramnumber.com/api/v1/gift-cards/checkout" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer gn_<your_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "category_id": "steam-us",
    "card_id": "steam-10",
    "quantity": 1
}'
GET /api/v1/gift-cards/orders Bearer token

List gift card orders

Parameters

Name In Type Required Description
limit query integer No —

Responses

  • 200 Response GiftCardOrdersListResponse
  • {
        "ok": true,
        "orders": [
            {
                "id": 1,
                "order_number": "string",
                "product_kind": "gift_card",
                "status": "completed",
                "status_label": "string",
                "category_id": "string",
                "card_id": "string",
                "product_name": "string",
                "product_image_url": "string",
                "quantity": 1,
                "price_charged_credits": 1,
                "price_usd_display": "string",
                "wallet_debited": true,
                "awaiting_payment": true,
                "remaining_credits": 1,
                "remaining_usd_display": "string",
                "codes": [
                    "string"
                ],
                "placed_via_api": true,
                "created_at": "string"
            }
        ]
    }
  • 401 Response Unauthorized
  • {
        "message": "Invalid API token."
    }

Example cURL

curl -sS -X GET "https://www.gramnumber.com/api/v1/gift-cards/orders" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer gn_<your_token>"
GET /api/v1/gift-cards/orders/{fazerCardsOrder} Bearer token

Get one gift card order

Syncs supplier status while processing. Completed orders include codes.

Parameters

Name In Type Required Description
fazerCardsOrder path integer Yes —

Responses

  • 200 Response
  • {
        "ok": true,
        "order": {
            "id": 1,
            "order_number": "string",
            "product_kind": "gift_card",
            "status": "completed",
            "status_label": "string",
            "category_id": "string",
            "card_id": "string",
            "product_name": "string",
            "product_image_url": "string",
            "quantity": 1,
            "price_charged_credits": 1,
            "price_usd_display": "string",
            "wallet_debited": true,
            "awaiting_payment": true,
            "remaining_credits": 1,
            "remaining_usd_display": "string",
            "codes": [
                "string"
            ],
            "placed_via_api": true,
            "created_at": "string"
        }
    }
  • 401 Response Unauthorized
  • {
        "message": "Invalid API token."
    }
  • 404 Not found or not owned by this user

Example cURL

curl -sS -X GET "https://www.gramnumber.com/api/v1/gift-cards/orders/{fazerCardsOrder}" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer gn_<your_token>"
GET /api/v1/gift-cards/orders/{fazerCardsOrder}/payment Bearer token

Gift card pending-payment status

Parameters

Name In Type Required Description
fazerCardsOrder path integer Yes —

Responses

  • 200 Remaining amount and can_complete flag
  • 401 Response Unauthorized
  • {
        "message": "Invalid API token."
    }
  • 404 Not found

Example cURL

curl -sS -X GET "https://www.gramnumber.com/api/v1/gift-cards/orders/{fazerCardsOrder}/payment" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer gn_<your_token>"
POST /api/v1/gift-cards/orders/{fazerCardsOrder}/payment Bearer token

Create Cryptomus top-up for pending gift card order

Parameters

Name In Type Required Description
fazerCardsOrder path integer Yes —

Responses

  • 200 Invoice created (`pay_url`) or already can_complete
  • 401 Response Unauthorized
  • {
        "message": "Invalid API token."
    }
  • 422 Order not awaiting payment
  • 503 Gateway unavailable

Example cURL

curl -sS -X POST "https://www.gramnumber.com/api/v1/gift-cards/orders/{fazerCardsOrder}/payment" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer gn_<your_token>"
POST /api/v1/gift-cards/orders/{fazerCardsOrder}/complete Bearer token

Complete pending gift card order after top-up

Parameters

Name In Type Required Description
fazerCardsOrder path integer Yes —

Responses

  • 201 Debited and fulfilled (or processing) GiftCardCheckoutResponse
  • {
        "ok": true,
        "awaiting_payment": true,
        "order": {
            "id": 1,
            "order_number": "string",
            "product_kind": "gift_card",
            "status": "completed",
            "status_label": "string",
            "category_id": "string",
            "card_id": "string",
            "product_name": "string",
            "product_image_url": "string",
            "quantity": 1,
            "price_charged_credits": 1,
            "price_usd_display": "string",
            "wallet_debited": true,
            "awaiting_payment": true,
            "remaining_credits": 1,
            "remaining_usd_display": "string",
            "codes": [
                "string"
            ],
            "placed_via_api": true,
            "created_at": "string"
        },
        "payment": {}
    }
  • 401 Response Unauthorized
  • {
        "message": "Invalid API token."
    }
  • 402 Still insufficient balance
  • 422 Invalid state

Example cURL

curl -sS -X POST "https://www.gramnumber.com/api/v1/gift-cards/orders/{fazerCardsOrder}/complete" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer gn_<your_token>"
POST /api/v1/gift-cards/orders/{fazerCardsOrder}/cancel Bearer token

Cancel a gift card order

Parameters

Name In Type Required Description
fazerCardsOrder path integer Yes —

Responses

  • 200 Cancelled (or refunded if already debited)
  • 401 Response Unauthorized
  • {
        "message": "Invalid API token."
    }
  • 422 Cancel not allowed

Example cURL

curl -sS -X POST "https://www.gramnumber.com/api/v1/gift-cards/orders/{fazerCardsOrder}/cancel" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer gn_<your_token>"

Legacy

Backwards-compatible storefront JSON

GET /api/shop/telegram/stars Public

Telegram Stars catalog (legacy path; same JSON as /api/v1/catalog/telegram/stars)

Responses

  • 200 Response TelegramStarsCatalogResponse
  • {
        "ok": true,
        "message": "string",
        "display_name": "string",
        "unit_price_usd": "$0.01",
        "min_custom_quantity": 49,
        "allows_custom_quantity": true,
        "unit_price_credits": 1,
        "preset_quantities": [
            50,
            75,
            100,
            150,
            250,
            350,
            500,
            750,
            1000,
            1500,
            2500,
            5000
        ],
        "packs": [
            {
                "quantity": 1,
                "price_credits": 1,
                "price_usd_display": "$5.00"
            }
        ]
    }
  • 503 Response TelegramStarsCatalogResponse
  • {
        "ok": true,
        "message": "string",
        "display_name": "string",
        "unit_price_usd": "$0.01",
        "min_custom_quantity": 49,
        "allows_custom_quantity": true,
        "unit_price_credits": 1,
        "preset_quantities": [
            50,
            75,
            100,
            150,
            250,
            350,
            500,
            750,
            1000,
            1500,
            2500,
            5000
        ],
        "packs": [
            {
                "quantity": 1,
                "price_credits": 1,
                "price_usd_display": "$5.00"
            }
        ]
    }

Example cURL

curl -sS -X GET "https://www.gramnumber.com/api/shop/telegram/stars" \
  -H "Accept: application/json"
GET /api/shop/telegram/premium Public

Telegram Premium catalog (legacy path; same JSON as /api/v1/catalog/telegram/premium)

Responses

  • 200 Response TelegramPremiumCatalogResponse
  • {
        "ok": true,
        "message": "string",
        "plans": [
            {
                "months": 1,
                "price_credits": 1,
                "price_usd": 1,
                "price_usd_display": "string",
                "wallet_price_display": "string"
            }
        ]
    }
  • 503 Response TelegramPremiumCatalogResponse
  • {
        "ok": true,
        "message": "string",
        "plans": [
            {
                "months": 1,
                "price_credits": 1,
                "price_usd": 1,
                "price_usd_display": "string",
                "wallet_price_display": "string"
            }
        ]
    }

Example cURL

curl -sS -X GET "https://www.gramnumber.com/api/shop/telegram/premium" \
  -H "Accept: application/json"
GET /api/shop/services Public

List all public services (legacy path; same JSON as /api/v1/catalog/services)

Use this endpoint when /api/v1/catalog/services is unavailable. Returns Telegram (Ozvinoo) plus 5sim products such as sim_whatsapp and sim_instagram. Fetch prices per service via GET /api/shop/{service}/prices or /api/v1/catalog/services/{service}/prices.

Responses

  • 200 Non-empty catalog CatalogServicesResponse
  • {
        "ok": true,
        "message": "string",
        "services": [
            {}
        ],
        "featured": {
            "primary": [
                {}
            ],
            "more": [
                {}
            ]
        },
        "irr_per_usd": 1,
        "markup_percent": 1
    }
  • 503 Upstream unavailable and no cached services ErrorResponse
  • {
        "ok": false,
        "message": "string"
    }

Example cURL

curl -sS -X GET "https://www.gramnumber.com/api/shop/services" \
  -H "Accept: application/json"
GET /api/shop/{service}/prices Public

Same as catalog prices (legacy path for storefront)

Parameters

Name In Type Required Description
service path string Yes —

Responses

  • 200 Response PricesResponse
  • {
        "ok": true,
        "message": "string",
        "rows": [
            {
                "country": "string",
                "range": "string",
                "count": "string",
                "base_price": 1,
                "price": 1,
                "usd": 1
            }
        ],
        "markup_percent": 1,
        "irr_per_usd": 1
    }

Example cURL

curl -sS -X GET "https://www.gramnumber.com/api/shop/{service}/prices" \
  -H "Accept: application/json"