import Whop from '@whop/sdk';
const client = new Whop({
apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});
const company = await client.companies.create({ title: 'title' });
console.log(company.id);{
"id": "biz_xxxxxxxxxxxxxx",
"title": "Pickaxe",
"description": "Learn the fundamentals of data analytics with hands-on projects.",
"verified": true,
"send_customer_emails": true,
"created_at": "2023-12-01T05:00:00.401Z",
"updated_at": "2023-12-01T05:00:00.401Z",
"member_count": 42,
"owner_user": {
"id": "user_xxxxxxxxxxxxx",
"name": "John Doe",
"username": "johndoe42"
},
"route": "pickaxe",
"logo": {
"url": "https://media.whop.com/abc123/optimized.jpg"
},
"published_reviews_count": 42,
"metadata": {},
"target_audience": "<string>",
"social_links": [
{
"id": "soci_xxxxxxxxxxxxx",
"url": "https://x.com/whop",
"website": "x"
}
],
"affiliate_instructions": "Share your unique link on social media to earn 20% commission.",
"featured_affiliate_product": {
"id": "prod_xxxxxxxxxxxxx",
"name": "<string>"
}
}Create a new company. Pass parent_company_id to create a connected account under a platform, or omit it to create a company for the current user.
Required permissions:
company:createcompany:basic:readimport Whop from '@whop/sdk';
const client = new Whop({
apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});
const company = await client.companies.create({ title: 'title' });
console.log(company.id);{
"id": "biz_xxxxxxxxxxxxxx",
"title": "Pickaxe",
"description": "Learn the fundamentals of data analytics with hands-on projects.",
"verified": true,
"send_customer_emails": true,
"created_at": "2023-12-01T05:00:00.401Z",
"updated_at": "2023-12-01T05:00:00.401Z",
"member_count": 42,
"owner_user": {
"id": "user_xxxxxxxxxxxxx",
"name": "John Doe",
"username": "johndoe42"
},
"route": "pickaxe",
"logo": {
"url": "https://media.whop.com/abc123/optimized.jpg"
},
"published_reviews_count": 42,
"metadata": {},
"target_audience": "<string>",
"social_links": [
{
"id": "soci_xxxxxxxxxxxxx",
"url": "https://x.com/whop",
"website": "x"
}
],
"affiliate_instructions": "Share your unique link on social media to earn 20% commission.",
"featured_affiliate_product": {
"id": "prod_xxxxxxxxxxxxx",
"name": "<string>"
}
}A company API key, company scoped JWT, app API key, or user OAuth token. You must prepend your key/token with the word 'Bearer', which will look like Bearer ***************************
Parameters for CreateCompany
The display name of the company shown to customers.
A promotional pitch displayed to potential customers on the company's store page.
The email address of the user who will own the connected account. Required when parent_company_id is provided.
The company's logo image. Accepts PNG, JPEG, or GIF format.
Show child attributes
A key-value JSON object of custom metadata to store on the company.
The unique identifier of the parent platform company. When provided, creates a connected account under that platform. Omit to create a company for the current user.
Whether Whop sends transactional emails to customers on behalf of this company. Only applies when creating a connected account.
A successful response
A company is a seller on Whop. Companies own products, manage members, and receive payouts.
The unique identifier for the company.
"biz_xxxxxxxxxxxxxx"
The display name of the company shown to customers.
"Pickaxe"
A promotional pitch written by the company creator, displayed to potential customers on the store page.
"Learn the fundamentals of data analytics with hands-on projects."
Whether this company has been verified by Whop's trust and safety team.
Whether Whop sends transactional emails (receipts, updates) to customers on behalf of this company.
The datetime the company was created.
"2023-12-01T05:00:00.401Z"
The datetime the company was last updated.
"2023-12-01T05:00:00.401Z"
The total number of users who currently hold active memberships across all of this company's products.
42
The user who owns and has full administrative control over this company.
Show child attributes
The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe).
"pickaxe"
The company's logo.
Show child attributes
The total number of published customer reviews across all products for this company.
42
A key-value JSON object of custom metadata for this company, managed by the platform that created the account.
The target audience for the company. Null if not set.
The list of social media accounts and external links associated with this company.
Show child attributes
Guidelines and instructions provided to affiliates explaining how to promote this company's products.
"Share your unique link on social media to earn 20% commission."
The product featured for affiliates to promote on this company's affiliate page. Null if none is configured.
Show child attributes
Was this page helpful?