TOP Group (The Open Platform) Purchases API

The Purchases API from TOP Group (The Open Platform) — 1 operation(s) for purchases.

OpenAPI Specification

top-group-purchases-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: REST api to TON blockchain explorer Accounts Purchases API
  version: 2.0.0
  description: Provide access to indexed TON blockchain
  contact:
    name: Support
    email: support@tonkeeper.com
servers:
- url: https://tonapi.io
- url: https://testnet.tonapi.io
- url: http://localhost:8081
tags:
- name: Purchases
paths:
  /v2/purchases/{account_id}/history:
    get:
      description: Get history of purchases
      operationId: getPurchaseHistory
      tags:
      - Purchases
      parameters:
      - $ref: '#/components/parameters/accountIDParameter'
      - name: before_lt
        in: query
        description: omit this parameter to get last invoices
        required: false
        schema:
          type: integer
          format: int64
          example: 25758317000002
          x-js-format: bigint
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          default: 100
          example: 100
          maximum: 1000
          minimum: 1
      responses:
        '200':
          description: account purchase history
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountPurchases'
        default:
          $ref: '#/components/responses/Error'
components:
  schemas:
    AccountAddress:
      type: object
      required:
      - address
      - is_scam
      - is_wallet
      properties:
        address:
          type: string
          format: maybe-address
          example: 0:10C1073837B93FDAAD594284CE8B8EFF7B9CF25427440EB2FC682762E1471365
        name:
          type: string
          example: Ton foundation
          description: Display name. Data collected from different sources like moderation lists, dns, collections names and over.
        is_scam:
          type: boolean
          example: true
          description: Is this account was marked as part of scammers activity
        icon:
          type: string
          example: https://ton.org/logo.png
        is_wallet:
          type: boolean
          example: true
    Price:
      type: object
      required:
      - currency_type
      - value
      - decimals
      - token_name
      - verification
      - image
      properties:
        currency_type:
          $ref: '#/components/schemas/CurrencyType'
        value:
          type: string
          x-js-format: bigint
          example: '123000000000'
        decimals:
          type: integer
          example: 9
        token_name:
          type: string
          example: Gram
        verification:
          $ref: '#/components/schemas/TrustType'
        image:
          type: string
          example: https://cache.tonapi.io/images/jetton.jpg
        jetton:
          type: string
          format: address
          example: 0:0BB5A9F69043EEBDDA5AD2E946EB953242BD8F603FE795D90698CEEC6BFC60A0
    AccountPurchases:
      type: object
      required:
      - purchases
      - next_from
      properties:
        purchases:
          type: array
          items:
            $ref: '#/components/schemas/Purchase'
        next_from:
          type: integer
          format: int64
          example: 25713146000001
    CurrencyType:
      type: string
      example: jetton
      enum:
      - native
      - extra_currency
      - jetton
      - fiat
    TrustType:
      type: string
      example: whitelist
      enum:
      - whitelist
      - graylist
      - blacklist
      - none
    InsufficientFunds:
      type: object
      description: 'Present on an error when a request failed because the source wallet does not hold enough TON to cover the required gas (error_code 50000).

        '
      required:
      - required
      - available
      properties:
        required:
          type: integer
          format: int64
          description: TON in nanotons required to cover transfer gas
          x-js-format: bigint
        available:
          type: integer
          format: int64
          description: TON in nanotons currently available on the source wallet
          x-js-format: bigint
    Metadata:
      type: object
      required:
      - encrypted_binary
      properties:
        encrypted_binary:
          type: string
          description: hex encoded bytes
        decryption_key:
          type: string
          description: hex encoded bytes
          example: dead.....beef
    Purchase:
      type: object
      required:
      - event_id
      - invoice_id
      - source
      - destination
      - lt
      - utime
      - amount
      - metadata
      properties:
        event_id:
          type: string
          example: e8b0e3fee4a26bd2317ac1f9952fcdc87dc08fdb617656b5202416323337372e
        invoice_id:
          type: string
          example: 03cfc582-b1c3-410a-a9a7-1f3afe326b3b
        source:
          $ref: '#/components/schemas/AccountAddress'
        destination:
          $ref: '#/components/schemas/AccountAddress'
        lt:
          type: integer
          format: int64
          example: 25713146000001
          x-js-format: bigint
        utime:
          type: integer
          format: int64
          example: 1645544908
        amount:
          $ref: '#/components/schemas/Price'
        metadata:
          $ref: '#/components/schemas/Metadata'
  responses:
    Error:
      description: Some error during request processing
      content:
        application/json:
          schema:
            type: object
            required:
            - error
            properties:
              error:
                type: string
              error_code:
                type: integer
                format: int64
              details:
                $ref: '#/components/schemas/InsufficientFunds'
  parameters:
    accountIDParameter:
      in: path
      name: account_id
      required: true
      description: account ID
      schema:
        type: string
        format: address
        example: 0:97264395BD65A255A429B11326C84128B7D70FFED7949ABAE3036D506BA38621