import { WhopClient } from "@whop/sdk";
const client = new WhopClient({ token: "YOUR_TOKEN", apiVersionDate: "2026-08-21-1", idempotencyKey: "YOUR_IDEMPOTENCY_KEY" });
await client.memberships.invite({
plan_id: "plan_xxxxxxxxxxxxxx",
user_id: "user_xxxxxxxxxxxxxx"
});curl --request POST \
--url https://api.whop.com/api/v1/memberships/invite \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"plan_id": "plan_xxxxxxxxxxxxxx",
"user_id": "user_xxxxxxxxxxxxxx",
"email": "marcus@shinetime.example"
}
'import requests
url = "https://api.whop.com/api/v1/memberships/invite"
payload = {
"plan_id": "plan_xxxxxxxxxxxxxx",
"user_id": "user_xxxxxxxxxxxxxx",
"email": "marcus@shinetime.example"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
plan_id: 'plan_xxxxxxxxxxxxxx',
user_id: 'user_xxxxxxxxxxxxxx',
email: 'marcus@shinetime.example'
})
};
fetch('https://api.whop.com/api/v1/memberships/invite', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.whop.com/api/v1/memberships/invite",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'plan_id' => 'plan_xxxxxxxxxxxxxx',
'user_id' => 'user_xxxxxxxxxxxxxx',
'email' => 'marcus@shinetime.example'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.whop.com/api/v1/memberships/invite"
payload := strings.NewReader("{\n \"plan_id\": \"plan_xxxxxxxxxxxxxx\",\n \"user_id\": \"user_xxxxxxxxxxxxxx\",\n \"email\": \"marcus@shinetime.example\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.whop.com/api/v1/memberships/invite")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"plan_id\": \"plan_xxxxxxxxxxxxxx\",\n \"user_id\": \"user_xxxxxxxxxxxxxx\",\n \"email\": \"marcus@shinetime.example\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.whop.com/api/v1/memberships/invite")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"plan_id\": \"plan_xxxxxxxxxxxxxx\",\n \"user_id\": \"user_xxxxxxxxxxxxxx\",\n \"email\": \"marcus@shinetime.example\"\n}"
response = http.request(request)
puts response.read_body{
"invitation_sent": true
}{
"error": {
"message": "account_id is required",
"type": "bad_request",
"code": "<string>"
}
}{
"error": {
"message": "account_id is required",
"type": "bad_request",
"code": "<string>"
}
}{
"error": {
"message": "account_id is required",
"type": "bad_request",
"code": "<string>"
}
}{
"error": {
"message": "account_id is required",
"type": "bad_request",
"code": "<string>"
}
}{
"error": {
"message": "account_id is required",
"type": "bad_request",
"code": "<string>"
}
}Invite to a Membership
Sends an email inviting one recipient to join the account through a free plan. Identify the recipient by exactly one of user_id or email. The invitation is bound to that recipient; after signing in, accepting it immediately grants the membership without checkout. This Experimental endpoint is available only to accounts enabled for membership invitations.
import { WhopClient } from "@whop/sdk";
const client = new WhopClient({ token: "YOUR_TOKEN", apiVersionDate: "2026-08-21-1", idempotencyKey: "YOUR_IDEMPOTENCY_KEY" });
await client.memberships.invite({
plan_id: "plan_xxxxxxxxxxxxxx",
user_id: "user_xxxxxxxxxxxxxx"
});curl --request POST \
--url https://api.whop.com/api/v1/memberships/invite \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"plan_id": "plan_xxxxxxxxxxxxxx",
"user_id": "user_xxxxxxxxxxxxxx",
"email": "marcus@shinetime.example"
}
'import requests
url = "https://api.whop.com/api/v1/memberships/invite"
payload = {
"plan_id": "plan_xxxxxxxxxxxxxx",
"user_id": "user_xxxxxxxxxxxxxx",
"email": "marcus@shinetime.example"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
plan_id: 'plan_xxxxxxxxxxxxxx',
user_id: 'user_xxxxxxxxxxxxxx',
email: 'marcus@shinetime.example'
})
};
fetch('https://api.whop.com/api/v1/memberships/invite', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.whop.com/api/v1/memberships/invite",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'plan_id' => 'plan_xxxxxxxxxxxxxx',
'user_id' => 'user_xxxxxxxxxxxxxx',
'email' => 'marcus@shinetime.example'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.whop.com/api/v1/memberships/invite"
payload := strings.NewReader("{\n \"plan_id\": \"plan_xxxxxxxxxxxxxx\",\n \"user_id\": \"user_xxxxxxxxxxxxxx\",\n \"email\": \"marcus@shinetime.example\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.whop.com/api/v1/memberships/invite")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"plan_id\": \"plan_xxxxxxxxxxxxxx\",\n \"user_id\": \"user_xxxxxxxxxxxxxx\",\n \"email\": \"marcus@shinetime.example\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.whop.com/api/v1/memberships/invite")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"plan_id\": \"plan_xxxxxxxxxxxxxx\",\n \"user_id\": \"user_xxxxxxxxxxxxxx\",\n \"email\": \"marcus@shinetime.example\"\n}"
response = http.request(request)
puts response.read_body{
"invitation_sent": true
}{
"error": {
"message": "account_id is required",
"type": "bad_request",
"code": "<string>"
}
}{
"error": {
"message": "account_id is required",
"type": "bad_request",
"code": "<string>"
}
}{
"error": {
"message": "account_id is required",
"type": "bad_request",
"code": "<string>"
}
}{
"error": {
"message": "account_id is required",
"type": "bad_request",
"code": "<string>"
}
}{
"error": {
"message": "account_id is required",
"type": "bad_request",
"code": "<string>"
}
}Authorizations
An Account API key, account-scoped JWT, App API key, or user OAuth token. Prepend the key or token with Bearer, for example Bearer ***************************.
Headers
A unique key that makes this request safe to retry. See Idempotent requests.
255"d9105228-4a08-46b1-8b91-42fed586d383"
Pins the request to a dated API version.
"2026-09-15"
Body
- InviteMembershipByUser
- InviteMembershipByEmail
Free plan whose membership the recipient is invited to, prefixed plan_.
"plan_xxxxxxxxxxxxxx"
Recipient user ID, prefixed user_. Mutually exclusive with email.
"user_xxxxxxxxxxxxxx"
Recipient email address. Mutually exclusive with user_id.
"marcus@shinetime.example"
Response
invitation accepted for delivery
true

