Glassbook API

The Glassbook API provides endpoints for managing partner transactions (PTX) and referrals. All endpoints require authentication.

Partner Transactions (PTX)

Create Partner Transaction

Create a new partner transaction record.

const accessToken = localStorage.getItem("accessToken");

const ptx = await sdk.glassbook.createPartnerTransaction(accessToken, {
  transactionHash: "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
  chainId: "1", // Ethereum
});

console.log(`PTX created: ${ptx.ptx.id}`);
console.log(`Status: ${ptx.ptx.status}`);

Get Partner Transactions

Get all partner transactions with pagination and filters.

const accessToken = localStorage.getItem("accessToken");

const transactions = await sdk.glassbook.getPartnerTransactions(accessToken, {
  page: 1,
  pageSize: 10,
  chainId: "1", // Optional filter
});

console.log(`Found ${transactions.pagination.total} transactions`);
transactions.data.forEach((tx) => {
  console.log(`PTX ${tx.id}: ${tx.transactionHash} - ${tx.status}`);
});

Get My Partner Transactions

Get the authenticated user's partner transactions.

Get Partner Transaction by ID

Get a specific partner transaction by its ID.

Referrals

Get My Referral

Get the authenticated user's referral information.

Get My Referral Stats

Get referral statistics for the authenticated user.

Get My Referred Addresses

Get addresses that were referred by the authenticated user.

Create Referral

Create a new referral with a custom code.

Check Referral Code Availability

Check if a referral code is available.

Get Referral by Code

Get referral information by code.

Get Referral by Address

Get referral information by address.

Complete Example

Next Steps

  • Forms API - Dynamic form handling

  • Examples - More examples

Last updated