This operation is only available on the server.
Required Permissions
access_pass:basic:read
Usage
Copy
Ask AI
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
Copy
Ask AI
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 access pass.
id: "xxxxxxxxxxx",
// When the access pass was created.
createdAt: 1716931200,
// The route of the access pass.
route: "some string",
// The title of the access pass. Use for Whop 4.0.
title: "some string",
// The headline of the access pass.
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 access pass will/will not be displayed publicly.
visibility:
"archived" /* Valid values: archived | hidden | quick_link | visible */,
// The number of active users for this access pass.
activeUsersCount: 10,
// The average of all reviews for this access pass.
reviewsAverage: 10,
// The creator pitch for the access pass.
creatorPitch: "some string",
// The timestamp (in milliseconds since epoch) of when the access pass was updated
updatedAtMs: "9999999",
// Whether to show the offers on the access pass.
showOffers: true,
// The URL to redirect the customer to after a purchase, if applicable.
redirectPurchaseUrl: "some string",
// The custom call to action for the access pass.
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 access pass, 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 access pass.
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 access pass.
memberAffiliateStatus:
"disabled" /* Valid values: disabled | enabled */,
// Whether to show the member count.
showMemberCount: true,
// The logo for the access pass.
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 access pass.
bannerImage: {
// The source of the attachment
source: {
// The URL to access the attachment
url: "some string",
},
},
},
],
},
};