POST
/
v2
/
memberships
/
{id}
/
add_free_days
Header
Path
Query
Body
curl --request POST \
  --url https://api.whop.com/api/v2/memberships/{id}/add_free_days \
  --header 'Content-Type: application/json' \
  --data '{
  "days": 123
}'
{
  "access_pass": "<string>",
  "affiliate_page_url": "<string>",
  "cancel_at_period_end": true,
  "checkout_session": "<string>",
  "created_at": 123,
  "custom_fields_responses": {},
  "custom_fields_responses_v2": {},
  "deliveries": {},
  "discord": {
    "id": "<string>",
    "image_url": "<string>",
    "username": "<string>"
  },
  "email": "<string>",
  "expires_at": 123,
  "id": "<string>",
  "license_key": "<string>",
  "manage_url": "<string>",
  "metadata": {},
  "nft_tokens": {
    "balance": 123,
    "current_holder": "<string>",
    "metadata": {},
    "smart_contract": {},
    "token_id": "<string>"
  },
  "payment_processor": "free",
  "plan": "<string>",
  "product": "<string>",
  "promo_code": "<string>",
  "quantity": 123,
  "renewal_period_end": 123,
  "renewal_period_start": 123,
  "status": "trialing",
  "stripe_customer_id": "<string>",
  "stripe_subscription_id": "<string>",
  "telegram_account_id": "<string>",
  "user": "<string>",
  "valid": true,
  "wallet_address": "<string>"
}

Headers

Authorization
string

Your API key, which can be found on the Whop Business Dashboard. You must prepend your key with the word 'Bearer', which will look like Bearer ***************************

Path Parameters

id
string
required

The ID of the Membership, which will look like mem_*************

Query Parameters

expand
enum<string>[]

Whether or not to expand the User, Plan, Product, or Promo Code on the returned Membership(s). Pass an array with each object(s) you want to expand, e.g. [product, plan, user, promo_code]

Available options:
product,
user,
plan,
promo_code

Body

application/json
days
integer
required

The number of free days the owner of the Membership should be given

Response

201 - application/json
access_pass
string

Access Pass has been deprecated for Product. Please use product instead and do not use access_pass.

affiliate_page_url
string

Gives the url of the page with the user's affiliate code appended. Does not guarantee the user can affiliate anything on the page.

cancel_at_period_end
boolean

Whether or not this membership is scheduled to cancel at the end of the renewal period.

checkout_session
string

The ID of the checkout session (like ch_***************) used to purchase this membership, if any.

created_at
integer

The time at which the Membership was created. Measured in seconds since the Unix epoch.

custom_fields_responses
object

Questions and answers collected from the User at checkout

custom_fields_responses_v2
object

Questions and answers collected from the User at checkout

deliveries
object

A hash of deliveries for this membership, as a series of key value pairs of the experience id to the delivery id. Ex. { 'exp_': 'dlv_' }

discord
object

The Discord account attached to this Membership

email
string

The email of the User attached to this Membership

expires_at
integer

The time of when the Membership is set to go expired

id
string

The ID of the Membership, which will look like mem_*************

license_key
string

The license key of the Membership

manage_url
string

The URL to manage the Membership (top-up, cancel, etc.)

metadata
object

The metadata of the Membership

nft_tokens
object

Nft tokens attached to this Membership

payment_processor
enum<string>

The payment processor used to pay for the Membership.

Available options:
free,
stripe,
coinbase,
crypto,
paypal
plan
string

The Plan attached to this Membership. By default this will just be the ID of the Plan, but you can expand it to get more information about the Plan by passing [plan] in the expand parameter.

product
string

The Product attached to this Membership. By default this will just be the ID of the Product, but you can expand it to get more information about the Product by passing [product] in the expand parameter.

promo_code
string

The Promo Code used to purchase this Membership. By default this will just be the ID of the Promo Code, but you can expand it to get more information about the Promo Code by passing [promo_code] in the expand parameter.

quantity
integer

The amount of items included in the Membership

renewal_period_end
integer

The UTC timestamp of when the Membership will end

renewal_period_start
integer

The UTC timestamp of when the Membership will begin

status
enum<string>

The status of the Membership

Available options:
trialing,
active,
past_due,
completed,
canceled,
expired,
unresolved
stripe_customer_id
string

The Stripe Customer ID attached to this Membership if it was checked out using Stripe

stripe_subscription_id
string

The Stripe Subscription ID attached to this Membership if it was checked out using Stripe

telegram_account_id
string

The Whop ID of their connected Telegram account, if any.

user
string

The User that owns this Membership. By default this will just be the ID of the User, but you can expand it to get more information about the User by passing [user] in the expand parameter.

valid
boolean

Whether or not the Membership has a valid status

wallet_address
string

The crypto wallet address used to pay for the Membership (if paid through the one-time ETH or renewal WETH Whop contracts)

Was this page helpful?