Purchases

Unified GMT purchase history

Changed on

Own purchases and wholesale orders sorted and paginated together. Wholesale accounts appear only inside their order. Search matches country names in Russian or English, phone fragments (including accounts inside wholesale orders), and order ID fragments. Pending single purchases are listed separately.

get/v1/purchases/history

Request

  • Base URL
    https://api.getmytg.com
  • Auth
    • API key in header x-api-key
    • or HTTP bearer

Query parameters

include'code_request'

Opt in to durable purchase status and current code_request. Without this option, legacy response fields and status semantics are preserved.

pageinteger

Page number.

Example:1
page_sizeinteger

Number of items per page.

Example:50
sort'date_asc' | 'date_desc'

Sort purchases by creation date

Example:date_desc
status'PENDING' | 'SUCCESS' | 'ERROR' | 'REFUND' | 'EXPIRED'

Legacy status projection: PENDING while the current retail code request is pending or failed, SUCCESS when its code is available. With include=code_request, status describes the durable purchase; code_request describes the current request. REFUND and access rules still apply.

Example:SUCCESS
phone_numberstring

Filter purchases by phone number fragment (partial match). Example: '123' matches '+71234567890'.

Example:123
searchstring

Russian or English country name fragment, phone number fragment, or order ID fragment. Use instead of phone_number.

Example:Ken

Response

Response for status 200

Example response

{
  "items": [
    {
      "id": 12345,
      "country_code": "US",
      "emoji": "🇺🇸",
      "display_name": {
        "ru": "США",
        "en": "United States"
      },
      "phone_number": "+12025550123",
      "price": {
        "amount": "1.50",
        "currency_code": "USD"
      },
      "status": "SUCCESS",
      "purchase_type": "SINGLE",
      "purchase_source": "BOT",
      "verification": {
        "code": "12345",
        "password": "secret123",
        "received_at": "2024-11-19T07:52:00.000Z"
      },
      "created_at": "2024-11-19T07:50:00.000Z"
    }
  ],
  "pagination": {
    "current_page": 1,
    "page_size": 50,
    "total_items": 150,
    "total_pages": 3,
    "has_next": true
  }
}

Changes

    • breaking

      removed the required property /// from the response with the status

    • info

      added the new optional query request parameter include

    • info

      added the optional property /// to the response with the status

    • info

      added the required property //// to the response with the status