Allmine API
Users and Discovery

Users transaction history

~5 dkBackendMobil / WebKararlı

Flat ve grouped transaction history endpoint'leri

Users Transaction History Endpoint

Amaç

Bu endpoint, giriş yapmış kullanıcının kredi hareketlerini tek listede birleştirip global sıralı ve sayfalı döndürür.

  • Endpoint: GET /api/v1/users/me/transactions
  • Auth: Bearer JWT zorunlu (Role.USER)
  • Varsayılan sıralama: occurredAt desc

Request

URL

GET /api/v1/users/me/transactions

  • Authorization: Bearer <JWT>

Query Parametreleri

ParametreTipZorunluVarsayılanAçıklama
pagenumberHayır1Sayfa numarası (min: 1)
limitnumberHayır20Sayfa boyutu (min: 1, max: 100)
typesstring[]Hayırtümüİşlem tipi filtresi (CSV veya tekrar eden query)
statusesstring[]HayırtümüDurum filtresi (pending, completed, failed, refunded)
directioncredit | debitHayırtümüİşlem yönü filtresi
dateFromISO datetimeHayır-Başlangıç tarihi (inclusive)
dateToISO datetimeHayır-Bitiş tarihi (inclusive)
sortasc | descHayırdescoccurredAt sıralama yönü

types Enum Değerleri

  • credit_purchase
  • stream_charge
  • stream_revenue
  • credit_transfer_sent
  • credit_transfer_received
  • stream_funding_contribution
  • stream_funding_refund
  • mini_crowd_funding_support
  • gift_spend
  • balance_lock_hold
  • balance_lock_refund

Kaynak Eşleme Özeti

SourceTypeDirectionStatusTime
credit_transactioncredit_purchasecreditkayıttaki statuscreatedAt
stream_billing (charge)stream_chargedebitkayıttaki statuscreatedAt
stream_billing (distribution)stream_revenuecreditkayıttaki statuscreatedAt
credit_transfer (sender)credit_transfer_sentdebitcompletedcreatedAt
credit_transfer (recipient)credit_transfer_receivedcreditcompletedcreatedAt
stream_fundingstream_funding_contributiondebitcompletedcreatedAt
stream_funding refund satırıstream_funding_refundcreditrefundedrefundedAt veya updatedAt
mini_crowd_fundingmini_crowd_funding_supportdebitcompletedcreatedAt
giftgift_spenddebitcompletedtimestamp
balance_lockbalance_lock_holddebitcompletedcreatedAt
balance_lock sentetik refundbalance_lock_refundcreditrefundedupdatedAt

Örnek Kullanım

Basit çağrı

curl -X GET 'https://api.allminelive.com/api/v1/users/me/transactions?page=1&limit=20' \
  -H 'Authorization: Bearer <JWT>'

Gift + lock filtreli çağrı

curl -X GET 'https://api.allminelive.com/api/v1/users/me/transactions?types=gift_spend,balance_lock_hold,balance_lock_refund&statuses=completed,refunded&sort=desc' \
  -H 'Authorization: Bearer <JWT>'

Tekrarlayan query param formatı

curl -X GET 'https://api.allminelive.com/api/v1/users/me/transactions?types=stream_revenue&types=gift_spend&direction=credit' \
  -H 'Authorization: Bearer <JWT>'

Response Tasarımı

Response, global interceptor nedeniyle BaseResponseDto formatında döner ve data alanı PaginatedResponseDto<UserTransactionHistoryItemDto> içerir.

{
  "isSuccess": true,
  "statusCode": 200,
  "data": {
    "list": [
      {
        "id": "gift_spend:67b4c8ef81f4d8f7dcbb12ab",
        "source": "gift",
        "sourceRecordId": "67b4c8ef81f4d8f7dcbb12ab",
        "type": "gift_spend",
        "direction": "debit",
        "amount": 9,
        "status": "completed",
        "occurredAt": "2026-02-25T10:30:00.000Z",
        "description": "Gift spend",
        "streamId": "67b4a2ef81f4d8f7dcbb0001",
        "streamTitle": "Friday Night Stream",
        "thumbnailUrl": "https://s.allminelive.com/live-streams/thumbnail-123.jpg",
        "counterpartyUserId": null,
        "counterpartyUsername": null,
        "creditPackageId": null,
        "storeType": null,
        "role": null,
        "revenuecatTransactionId": null,
        "notes": "giftTypeId:67b4a2ef81f4d8f7dcbb9999",
        "previousBalance": null,
        "newBalance": null
      }
    ],
    "pagination": {
      "currentPage": 1,
      "totalPages": 3,
      "totalItems": 51,
      "itemsPerPage": 20,
      "hasNextPage": true,
      "hasPrevPage": false
    }
  },
  "errors": [],
  "timestamp": "2026-02-25T10:30:00.100Z"
}

UserTransactionHistoryItemDto Alanları

  • id: Unified history item id
  • source: credit_transaction | stream_billing | credit_transfer | stream_funding | mini_crowd_funding | gift | balance_lock
  • sourceRecordId: Orijinal doküman id
  • type: Yukarıdaki enum
  • direction: credit | debit
  • amount: Kredi miktarı
  • status: pending | completed | failed | refunded
  • occurredAt: İşlem zamanı
  • description: Kısa açıklama
  • streamId: İlgili stream id
  • streamTitle: Enrichment ile stream title
  • thumbnailUrl: Enrichment ile stream thumbnail URL
  • counterpartyUserId: Karşı kullanıcı id (varsa)
  • counterpartyUsername: Enrichment ile karşı kullanıcı username
  • creditPackageId, storeType, role, revenuecatTransactionId, notes, previousBalance, newBalance: kaynağa bağlı opsiyonel alanlar

Grouped Response

Flat response kontratı değişmez. Live stream bazlı gruplama için ayrı endpointler kullanılır:

  • GET /api/v1/users/me/transactions/grouped
  • GET /api/v1/users/admin/:id/transactions/grouped

Bu endpointler aynı query parametrelerini kullanır. Pagination group bazlıdır: totalItems filtreye uyan grouped entry sayısını, itemsPerPage istenen group/standalone entry limitini gösterir. Bir streamId tüm grouped sonuç setinde en fazla bir kez döner; o stream için filtreye uyan tüm transactionlar aynı stream_group.transactions içinde yer alır. Bu nedenle bir sayfada limit değerinden daha fazla transaction satırı görülebilir.

data.list mixed entry döner:

  • entryType: "stream_group": id, streamId, streamTitle, thumbnailUrl, transactions
  • entryType: "transaction": id, streamId olmayan standalone transaction için transaction
{
  "isSuccess": true,
  "statusCode": 200,
  "data": {
    "list": [
      {
        "id": "stream_group:67b4a2ef81f4d8f7dcbb0001",
        "entryType": "stream_group",
        "streamId": "67b4a2ef81f4d8f7dcbb0001",
        "streamTitle": "Friday Night Stream",
        "thumbnailUrl": "https://s.allminelive.com/live-streams/thumbnail-123.jpg",
        "transactions": [
          {
            "id": "gift_spend:67b4c8ef81f4d8f7dcbb12ab",
            "source": "gift",
            "sourceRecordId": "67b4c8ef81f4d8f7dcbb12ab",
            "type": "gift_spend",
            "direction": "debit",
            "amount": 9,
            "status": "completed",
            "occurredAt": "2026-02-25T10:30:00.000Z",
            "description": "Gift spend",
            "streamId": "67b4a2ef81f4d8f7dcbb0001",
            "streamTitle": "Friday Night Stream",
            "thumbnailUrl": "https://s.allminelive.com/live-streams/thumbnail-123.jpg",
            "counterpartyUserId": null,
            "counterpartyUsername": null,
            "creditPackageId": null,
            "storeType": null,
            "role": null,
            "revenuecatTransactionId": null,
            "notes": "giftTypeId:67b4a2ef81f4d8f7dcbb9999",
            "previousBalance": null,
            "newBalance": null
          }
        ]
      },
      {
        "id": "transaction:credit_transaction:67b4c8ef81f4d8f7dcbb12ac",
        "entryType": "transaction",
        "transaction": {
          "id": "credit_transaction:67b4c8ef81f4d8f7dcbb12ac",
          "source": "credit_transaction",
          "sourceRecordId": "67b4c8ef81f4d8f7dcbb12ac",
          "type": "credit_purchase",
          "direction": "credit",
          "amount": 100,
          "status": "completed",
          "occurredAt": "2026-02-25T10:10:00.000Z",
          "description": "Credit purchase",
          "streamId": null,
          "streamTitle": null,
          "thumbnailUrl": null,
          "counterpartyUserId": null,
          "counterpartyUsername": null,
          "creditPackageId": "67b4c8ef81f4d8f7dcbb0002",
          "storeType": "stripe",
          "role": null,
          "revenuecatTransactionId": "pi_123",
          "notes": "Credit purchase",
          "previousBalance": 0,
          "newBalance": 100
        }
      }
    ],
    "pagination": {
      "currentPage": 1,
      "totalPages": 3,
      "totalItems": 51,
      "itemsPerPage": 20,
      "hasNextPage": true,
      "hasPrevPage": false
    }
  },
  "errors": [],
  "timestamp": "2026-02-25T10:30:00.100Z"
}

thumbnailUrl Davranışı

  • Transaction canlı yayınla ilişkiliyse (streamId dolu), streamTitle ve thumbnailUrl LiveStream kaydından batch enrichment ile doldurulur.
  • Canlı yayınla ilişkili değilse alanlar null döner.
  • streamId var ama stream bulunamazsa streamTitle ve thumbnailUrl yine null kalır.

Hata Kodları

  • 400 Bad Request
    • Geçersiz query parametreleri
    • dateTo < dateFrom
  • 401 Unauthorized
    • Eksik veya geçersiz token

Swagger Kullanımı

  1. users tag altında GET /users/me/transactions endpointini açın.
  2. Authorize ile JWT girin.
  3. Parametreleri doldurup Try it out -> Execute çalıştırın.
  4. TypeError: Load failed görürseniz:
    • Swagger server URL'sini doğrulayın
    • Aynı isteği curl ile çağırıp backend erişimini kontrol edin

On this page