GET
/
api
/
loyalty
/
transaction_entries
import SnagSolutions from '@snagsolutions/sdk';

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

async function main() {
  const response = await client.loyalty.transactions.getTransactionEntries();

  console.log(response.data);
}

main();
{
  "data": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174040",
      "organizationId": "123e4567-e89b-12d3-a456-426614174001",
      "websiteId": "123e4567-e89b-12d3-a456-426614174002",
      "loyaltyAccountId": "123e4567-e89b-12d3-a456-426614174050",
      "direction": "credit",
      "type": "loyalty_rule",
      "createdAt": "2023-10-01T12:34:56Z",
      "updatedAt": "2023-10-05T15:30:00Z",
      "amount": 100,
      "metadata": {
        "orderId": "order123"
      },
      "loyaltyTransaction": {
        "id": "123e4567-e89b-12d3-a456-426614174060",
        "type": "order",
        "loyaltyRule": {
          "id": "123e4567-e89b-12d3-a456-426614174070",
          "name": "First Purchase Bonus",
          "description": "Bonus points for the first purchase",
          "type": "purchase",
          "metadata": {
            "category": "electronics"
          }
        }
      }
    }
  ],
  "hasNextPage": true
}

Authorizations

X-API-KEY
string
header
required

Query Parameters

organizationId
string

Unique identifier for the organization to filter by

Example:

"123e4567-e89b-12d3-a456-426614174001"

websiteId
string

Unique identifier for the website to filter by

Example:

"123e4567-e89b-12d3-a456-426614174002"

startingAfter
string

Pagination cursor to start after a specific resource ID

Example:

"123e4567-e89b-12d3-a456-426614174010"

limit
integer
default:10

Maximum number of records to return (max 1000)

Required range: 1 <= x <= 1000
Example:

50

walletAddress

Wallet address or array of wallet addresses to filter by

Example:
[
  "0x1234567890abcdef1234567890abcdef12345678"
]
userId

User ID or array of User IDs to filter by

Example:
["123e4567-e89b-12d3-a456-426614174000"]
walletGroupIdentifier
string

Identifier for the wallet group to filter by

Example:

"group123"

loyaltyTransactionId
string

Unique identifier for the loyalty transaction to filter by

Example:

"123e4567-e89b-12d3-a456-426614174020"

loyaltyRuleId
string

Unique identifier for the loyalty rule to filter by

Example:

"123e4567-e89b-12d3-a456-426614174030"

loyaltyRuleType
Available options:
Bonus,
BoughtOn,
BoughtWithRoyalties,
DiscordMessages,
Listing,
Lodging,
MintOn,
PoapClaim,
SnagSocialsConnected,
SnapshotFullset,
SnapshotHold,
SoldOn,
SoldWithRoyalties,
TokenHold,
TwitterBio,
TwitterHashTagPost,
Retweet,
check_in,
code_entry,
connect_wallet,
connected_discord,
connected_email,
connected_epic,
connected_steam,
connected_telegram,
connected_twitter,
create_partner_account,
discord_member,
drip_x_follow,
drip_x_new_tweet,
drip_x_text_in_bio,
drip_x_text_in_comment,
drip_x_text_in_name,
drip_x_tweet,
external_rule,
link_click,
manual_upload,
profile_completed,
referred_user,
smart_contract_event,
snapshot_governance,
telegram_join,
telegram_messages,
text_input,
token_hold_erc20,
tweet_liked_by_project,
twitter_comment,
twitter_follow,
twitter_followers,
twitter_like,
twitter_post_hashtag,
quiz,
poll
idempotencyKey
string

Key to ensure idempotency of the request

Example:

"idempkey123"

direction
enum<string>

Direction of the transaction entry to filter by

Available options:
credit,
debit
Example:

"credit"

type
enum<string>

Type of the loyalty transaction to filter by

Available options:
auction_bid,
direct_mint,
loyalty_rule,
api_key,
order
Example:

"loyalty_rule"

orderBy
enum<string>
default:createdAt

Field to order the results by

Available options:
createdAt,
updatedAt,
loyaltyAccountLockVersion
Example:

"createdAt"

userCompletedLoyaltyRuleId

When passed in return the list of fulfilled entries for loyalty rules. If a loyalty rule has a fulfilled entry this means the user cannot currently complete the rule. Must be passed in with userId or walletAddress.

Example:

"123e4567-e89b-12d3-a456-426614174030"

userGroupExternalIdentifier
string

External identifier for the user group controlled by you

userGroupId
string

Unique identifier for the user group

Example:

"123e4567-e89b-12d3-a456-426614174090"

createdAtStart
string

Start date to filter by (inclusive, greater than or equal to)

Example:

"2023-10-01T12:34:56Z"

createdAtEnd
string

End date to filter by (exclusive, less than)

Example:

"2023-10-01T12:34:56Z"

Response

200
application/json
200
data
object[]
required

Schema for a loyalty transaction entry

hasNextPage
boolean
required