Перейти к основному содержанию
GET
/
v1
/
purchases
/
bulk
/
{purchase_id}
JavaScript
import Gmt from 'gmt-typescript-sdk';

const client = new Gmt({
  apiKey: process.env['GMT_API_KEY'], // This is the default and can be omitted
});

const bulk = await client.purchases.bulk.retrieve('purchase_id');

console.log(bulk.bulk_purchase_id);
{
  "bulk_purchase_id": 123,
  "country_code": "<string>",
  "quantity": 4503599627370496,
  "total_price": {
    "amount": "1.50",
    "currency_code": "USD"
  },
  "price_per_account": {
    "amount": "1.50",
    "currency_code": "USD"
  },
  "item": {
    "export_id": "550e8400-e29b-41d4-a716-446655440000",
    "archive_url": "/v1/purchases/bulk/123/download",
    "quantity": 10,
    "created_at": "2024-11-19T08:15:00.000Z"
  },
  "created_at": "<string>",
  "updated_at": "<string>"
}

Авторизации

x-api-key
string
header
обязательно

API-key that you received from Telegram Bot.

Параметры пути

purchase_id
string
обязательно

Ответ

200 - application/json

Response for status 200

bulk_purchase_id
integer
обязательно

Unique ID of the bulk purchase request

Требуемый диапазон: 1 <= x <= 9007199254740991
Пример:

123

country_code
string
обязательно

ISO 3166-1 alpha-2 country code.

quantity
integer
обязательно

Number of accounts in this purchase

Требуемый диапазон: 1 <= x <= 9007199254740991
total_price
object
обязательно

Total price for all accounts

price_per_account
object
обязательно

Price of a single account

item
object
обязательно

Archive data (only populated when status is SUCCESS)

status
enum<string>
обязательно

Current status of bulk purchase

Доступные опции:
PENDING,
SUCCESS,
ERROR,
REFUND
created_at
string
обязательно

Bulk purchase creation timestamp

updated_at
string
обязательно

Last update timestamp