Skip to main content
This function and all other functions in this graphql sdk are deprecated. Please migrate to the new rest api.
This operation is only available on the server.

Required Permissions

  • access_pass:basic:read

Usage

import { whopSdk } from "@/lib/whop-sdk";

const result = await whopSdk.companies.listAccessPasses({
	// ID of the company, either the tag (biz_xxx) or the page route (whop-dev)
	companyId: "biz_XXXXXXXX" /* Required! */,

	visibility:
		"all" /* Valid values: all | archived | hidden | not_archived | not_quick_link | quick_link | visible */,

	order:
		"active_memberships_count" /* Valid values: active_memberships_count | created_at | usd_gmv | usd_gmv_30_days */,

	last: 10,

	first: 10,

	direction: "asc" /* Valid values: asc | desc */,

	conditions: ["has_plans" /* Valid values: has_plans */],

	before: "pageInfo.startCursor",

	after: "pageInfo.endCursor",

	accessPassTypes: [
		"api_only" /* Valid values: api_only | app | experience_upsell | regular */,
	],
});

Example output

const result = {
	// All of the access passes connected to the company.
	accessPasses: {
		// The total number of items in this connection.
		totalCount: 10,

		// Information to aid in pagination.
		pageInfo: {
			// When paginating forwards, the cursor to continue.
			endCursor: "some string",

			// When paginating forwards, are there more items?
			hasNextPage: true,

			// When paginating backwards, are there more items?
			hasPreviousPage: true,

			// When paginating backwards, the cursor to continue.
			startCursor: "some string",
		},

		// A list of nodes.
		nodes: [
			{
				// The internal ID of the public product.
				id: "xxxxxxxxxxx",

				// When the product was created.
				createdAt: 1716931200,

				// The route of the product.
				route: "some string",

				// The title of the product. Use for Whop 4.0.
				title: "some string",

				// The headline of the product.
				headline: "some string",

				// A short description of what the company offers or does.
				shortenedDescription: "some string",

				// Whether this product is Whop verified.
				verified: true,

				// This product will/will not be displayed publicly.
				visibility:
					"archived" /* Valid values: archived | hidden | quick_link | visible */,

				// The number of active users for this product.
				activeUsersCount: 10,

				// The average of all reviews for this product.
				reviewsAverage: 10,

				// The creator pitch for the product.
				creatorPitch: "some string",

				// The timestamp (in milliseconds since epoch) of when the product was updated
				updatedAtMs: "9999999",

				// Whether to show the offers on the product.
				showOffers: true,

				// The URL to redirect the customer to after a purchase, if applicable.
				redirectPurchaseUrl: "some string",

				// The custom call to action for the product.
				customCta:
					"apply_now" /* Valid values: apply_now | call_now | complete_order | contact_us | donate_now | get_access | get_offer | join | order_now | purchase | shop_now | sign_up | subscribe */,

				// The custom call to action URL for the product, if any.
				customCtaUrl: "some string",

				// The percentage of a transaction a user is eligible to earn from the whop marketplace global affiliate program.
				globalAffiliatePercentage: 10,

				// The status of the global affiliate program for this product.
				globalAffiliateStatus:
					"disabled" /* Valid values: disabled | enabled */,

				// The percentage of a transaction a user is eligible to earn from the whop marketplace member affiliate program.
				memberAffiliatePercentage: 10,

				// The status of the member affiliate program for this product.
				memberAffiliateStatus:
					"disabled" /* Valid values: disabled | enabled */,

				// Whether to show the member count.
				showMemberCount: true,

				// The logo for the product.
				logo: {
					// The original URL of the attachment, such as a direct link to S3. This should
					// never be displayed on the client and always passed to an Imgproxy transformer.
					sourceUrl: "some string",
				},

				// The banner image for the product.
				bannerImage: {
					// The source of the attachment
					source: {
						// The URL to access the attachment
						url: "some string",
					},
				},
			},
		],
	},
};