API 参考

GramNumber Virtual Numbers API

OpenAPI 1.0.0

下载 openapi.yaml 基础 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

身份验证

销售接口需要与钱包绑定的 Bearer 令牌。请在每个已认证请求中发送:

Authorization: Bearer gn_<secret>

在个人资料或服务器上创建令牌:php artisan sales-api:create-token user@example.com my-integration

Catalog

Public service list and live prices

GET /api/v1/catalog/services 公开

List all public services

响应

  • 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"
    }

cURL 示例

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

Live price rows for one service

参数

名称 位置 类型 必填 说明
service path string 是 Service identifier: `telegram`, numeric Ozvinoo id, or `sim_{slug}` for 5sim (e.g. `sim_whatsapp`).

响应

  • 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"
    }

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 令牌

Current token owner profile & wallet

响应

  • 200 响应 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 响应 Unauthorized
  • {
        "message": "Invalid API token."
    }

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 令牌

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.

请求体 CheckoutRequest

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

响应

  • 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 响应 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"
            }
        ]
    }

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 令牌

List virtual number orders

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

参数

名称 位置 类型 必填 说明
limit query integer 否 —

响应

  • 200 响应 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 响应 Unauthorized
  • {
        "message": "Invalid API token."
    }

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 令牌

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

参数

名称 位置 类型 必填 说明
order path integer 是 —

响应

  • 200 响应
  • {
        "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 响应 Unauthorized
  • {
        "message": "Invalid API token."
    }
  • 404 Not found or not owned by this user

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 令牌

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.

参数

名称 位置 类型 必填 说明
order path integer 是 —

响应

  • 200 响应 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 响应 Unauthorized
  • {
        "message": "Invalid API token."
    }
  • 404 Not found or not owned by this user

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 令牌

Cancel a virtual number order

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

参数

名称 位置 类型 必填 说明
order path integer 是 —

响应

  • 200 响应 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 响应 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"
    }

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 公开

Telegram Stars packs and pricing

响应

  • 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"
            }
        ]
    }

cURL 示例

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

Telegram Premium plans and pricing

响应

  • 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"
            }
        ]
    }

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 公开

Telegram Gift collections

响应

  • 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"
            }
        ]
    }

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 公开

List gifts in a collection (on sale)

参数

名称 位置 类型 必填 说明
collection_id query string 是 —
sort query string 否 —

响应

  • 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

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 公开

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.

请求体 TelegramGiftQuoteRequest

{
    "gift_slug": "plushpepe-42"
}

响应

  • 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"
    }

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 令牌

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.

请求体 TelegramStarsPurchaseRequest

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

响应

  • 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 响应 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": {}
    }

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 令牌

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.

请求体 TelegramPremiumPurchaseRequest

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

响应

  • 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 响应 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": {}
    }

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 令牌

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.

请求体 TelegramGiftPurchaseRequest

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

响应

  • 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 响应 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": {}
    }

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 令牌

List Telegram Stars / Premium / Gift orders

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

参数

名称 位置 类型 必填 说明
limit query integer 否 —

响应

  • 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 响应 Unauthorized
  • {
        "message": "Invalid API token."
    }

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 令牌

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.

参数

名称 位置 类型 必填 说明
telegramProductOrder path integer 是 —

响应

  • 200 响应
  • {
        "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 响应 Unauthorized
  • {
        "message": "Invalid API token."
    }
  • 404 Not found or not owned by this user

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 令牌

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.

参数

名称 位置 类型 必填 说明
telegramProductOrder path integer 是 —

响应

  • 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 响应 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": {}
    }

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 令牌

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.

参数

名称 位置 类型 必填 说明
telegramProductOrder path integer 是 —

响应

  • 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 响应 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": {}
    }

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 令牌

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.

参数

名称 位置 类型 必填 说明
telegramProductOrder path integer 是 —

响应

  • 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 响应 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": {}
    }

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 令牌

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.

参数

名称 位置 类型 必填 说明
telegramProductOrder path integer 是 —

响应

  • 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 响应 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": {}
    }

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 公开

SecureTD product categories

响应

  • 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
            }
        ]
    }

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 公开

SecureTD products in one category

参数

名称 位置 类型 必填 说明
categoryId path integer 是 —

响应

  • 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"
            }
        ]
    }

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 公开

Search SecureTD products by country name or dial code

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

参数

名称 位置 类型 必填 说明
q query string 否 Country name or dial code (e.g. `+1`, `USA`, `Germany`)

响应

  • 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"
            }
        ]
    }

cURL 示例

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

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.

请求体 SecureTdCheckoutRequest

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

响应

  • 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 响应 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": {}
    }

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 令牌

List SecureTD orders

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

参数

名称 位置 类型 必填 说明
limit query integer 否 —

响应

  • 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 响应 Unauthorized
  • {
        "message": "Invalid API token."
    }

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 令牌

Get one SecureTD order

Syncs supplier task status when the order is still processing.

参数

名称 位置 类型 必填 说明
secureTdOrder path integer 是 —

响应

  • 200 响应
  • {
        "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 响应 Unauthorized
  • {
        "message": "Invalid API token."
    }
  • 404 Not found or not owned by this user

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 令牌

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.

参数

名称 位置 类型 必填 说明
secureTdOrder path integer 是 —

响应

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

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 公开

Custom Tdata product categories

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

响应

  • 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
            }
        ]
    }

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 公开

Custom Tdata products in one category

Same response shape as SecureTD category products.

参数

名称 位置 类型 必填 说明
categoryId path integer 是 —

响应

  • 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"
            }
        ]
    }

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 公开

Search Custom Tdata offers

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

参数

名称 位置 类型 必填 说明
q query string 否 Country name or dial code

响应

  • 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"
    }

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 令牌

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.

请求体 CustomTdataCheckoutRequest

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

响应

  • 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 响应 Unauthorized
  • {
        "message": "Invalid API token."
    }
  • 402 Insufficient wallet balance CustomTdataCheckoutFailure
  • {
        "ok": false,
        "error": "string",
        "message": "string"
    }
  • 422 响应 CustomTdataCheckoutFailure
  • {
        "ok": false,
        "error": "string",
        "message": "string"
    }
  • 503 Custom Tdata checkout disabled

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 令牌

List Custom Tdata orders

参数

名称 位置 类型 必填 说明
limit query integer 否 —

响应

  • 200 响应 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 响应 Unauthorized
  • {
        "message": "Invalid API token."
    }

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 令牌

Get one Custom Tdata order

Syncs supplier status while the order is still processing.

参数

名称 位置 类型 必填 说明
customTdataOrder path integer 是 —

响应

  • 200 响应
  • {
        "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 响应 Unauthorized
  • {
        "message": "Invalid API token."
    }
  • 404 Not found or not owned by this user

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 令牌

Download completed Custom Tdata archive

参数

名称 位置 类型 必填 说明
customTdataOrder path integer 是 —

响应

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

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 公开

List gift card categories

响应

  • 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"
            }
        ]
    }

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} 公开

Gift card offers in one category

参数

名称 位置 类型 必填 说明
categoryId path string 是 —

响应

  • 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

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 令牌

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).

请求体 GiftCardCheckoutRequest

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

响应

  • 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 响应 Unauthorized
  • {
        "message": "Invalid API token."
    }
  • 402 Insufficient balance (hard fail paths)
  • 422 Validation / invalid offer / out of stock
  • 503 Gift cards unavailable

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 令牌

List gift card orders

参数

名称 位置 类型 必填 说明
limit query integer 否 —

响应

  • 200 响应 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 响应 Unauthorized
  • {
        "message": "Invalid API token."
    }

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 令牌

Get one gift card order

Syncs supplier status while processing. Completed orders include codes.

参数

名称 位置 类型 必填 说明
fazerCardsOrder path integer 是 —

响应

  • 200 响应
  • {
        "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 响应 Unauthorized
  • {
        "message": "Invalid API token."
    }
  • 404 Not found or not owned by this user

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 令牌

Gift card pending-payment status

参数

名称 位置 类型 必填 说明
fazerCardsOrder path integer 是 —

响应

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

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 令牌

Create Cryptomus top-up for pending gift card order

参数

名称 位置 类型 必填 说明
fazerCardsOrder path integer 是 —

响应

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

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 令牌

Complete pending gift card order after top-up

参数

名称 位置 类型 必填 说明
fazerCardsOrder path integer 是 —

响应

  • 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 响应 Unauthorized
  • {
        "message": "Invalid API token."
    }
  • 402 Still insufficient balance
  • 422 Invalid state

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 令牌

Cancel a gift card order

参数

名称 位置 类型 必填 说明
fazerCardsOrder path integer 是 —

响应

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

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 公开

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

响应

  • 200 响应 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 响应 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"
            }
        ]
    }

cURL 示例

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

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

响应

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

cURL 示例

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

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.

响应

  • 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"
    }

cURL 示例

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

Same as catalog prices (legacy path for storefront)

参数

名称 位置 类型 必填 说明
service path string 是 —

响应

  • 200 响应 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
    }

cURL 示例

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