Memberships

Update membership

Update a membership's metadata or other mutable properties.

Required permissions:

  • member:manage
  • member:email:read
  • member:basic:read
patch/memberships/{id}

Path parameters

idstring required
Example:mem_xxxxxxxxxxxxxx

The unique identifier of the membership to update.

Request body

metadataobject nullable

A JSON object of key-value pairs to store on the membership. Replaces any existing metadata.

Response

A successful response

cancel_at_period_endboolean required

Whether this membership is set to cancel at the end of the current billing cycle. Only applies to memberships with a recurring plan.

cancel_option'too_expensive' | 'switching' | 'missing_features' | 'technical_issues' | 'bad_experience' | 'other' | 'testing' required

The different reasons a user can choose for why they are canceling their membership.

canceled_atstring date-time nullable required

The time the customer initiated cancellation of this membership. As a Unix timestamp. Null if the membership has not been canceled.

cancellation_reasonstring nullable required

Free-text explanation provided by the customer when canceling. Null if the customer did not provide a reason.

checkout_configuration_idstring nullable required

The ID of the checkout session/configuration that produced this membership, if any. Use this to map memberships back to the checkout configuration that created them.

created_atstring date-time required

The datetime the membership was created.

currency'usd' | 'sgd' | 'inr' | 'aud' | 'brl' | 'cad' | 'dkk' | 'eur' | 'nok' | 'gbp' | 'sek' | 'chf' | 'hkd' | 'huf' | 'jpy' | 'mxn' | 'myr' | 'pln' | 'czk' | 'nzd' | 'aed' | 'eth' | 'ape' | 'cop' | 'ron' | 'thb' | 'bgn' | 'idr' | 'dop' | 'php' | 'try' | 'krw' | 'twd' | 'vnd' | 'pkr' | 'clp' | 'uyu' | 'ars' | 'zar' | 'dzd' | 'tnd' | 'mad' | 'kes' | 'kwd' | 'jod' | 'all' | 'xcd' | 'amd' | 'bsd' | 'bhd' | 'bob' | 'bam' | 'khr' | 'crc' | 'xof' | 'egp' | 'etb' | 'gmd' | 'ghs' | 'gtq' | 'gyd' | 'ils' | 'jmd' | 'mop' | 'mga' | 'mur' | 'mdl' | 'mnt' | 'nad' | 'ngn' | 'mkd' | 'omr' | 'pyg' | 'pen' | 'qar' | 'rwf' | 'sar' | 'rsd' | 'lkr' | 'tzs' | 'ttd' | 'uzs' | 'rub' | 'btc' | 'cny' | 'usdt' | 'kzt' | 'awg' | 'whop_usd' | 'xau' required

The available currencies on the platform

idstring required

The unique identifier for the membership.

joined_atstring date-time nullable required

The time the user first joined the company associated with this membership. As a Unix timestamp. Null if the member record does not exist.

license_keystring nullable required

The software license key associated with this membership. Only present if the product includes a Whop Software Licensing experience. Null otherwise.

manage_urlstring nullable required

The URL where the customer can view and manage this membership, including cancellation and plan changes. Null if no member record exists.

metadataobject nullable required

Custom key-value pairs for the membership (commonly used for software licensing, e.g., HWID). Max 50 keys, 100 chars per key, 500 chars per string value.

payment_collection_pausedboolean required

Whether recurring payment collection for this membership is temporarily paused by the company.

renewal_period_endstring date-time nullable required

The end of the current billing period for this recurring membership. As a Unix timestamp. Null if the membership is not recurring.

renewal_period_startstring date-time nullable required

The start of the current billing period for this recurring membership. As a Unix timestamp. Null if the membership is not recurring.

status'trialing' | 'active' | 'past_due' | 'completed' | 'canceled' | 'expired' | 'unresolved' | 'drafted' | 'canceling' required

The status of a membership

updated_atstring date-time required

The datetime the membership was last updated.

Example response

{
  "canceled_at": "2023-12-01T05:00:00.401Z",
  "cancellation_reason": "I found a better alternative.",
  "company": {
    "id": "biz_xxxxxxxxxxxxxx",
    "title": "Pickaxe"
  },
  "created_at": "2023-12-01T05:00:00.401Z",
  "custom_field_responses": [
    {
      "id": "cfrp_xxxxxxxxxxxxx"
    }
  ],
  "id": "mem_xxxxxxxxxxxxxx",
  "joined_at": "2023-12-01T05:00:00.401Z",
  "license_key": "A1B2C3-D4E5F6-G7H8I9",
  "manage_url": "https://whop.com/billing/manage/mem_abc123",
  "member": {
    "id": "mber_xxxxxxxxxxxxx"
  },
  "plan": {
    "id": "plan_xxxxxxxxxxxxx"
  },
  "product": {
    "id": "prod_xxxxxxxxxxxxx",
    "title": "Pickaxe Analytics"
  },
  "promo_code": {
    "id": "promo_xxxxxxxxxxxx"
  },
  "renewal_period_end": "2023-12-01T05:00:00.401Z",
  "renewal_period_start": "2023-12-01T05:00:00.401Z",
  "updated_at": "2023-12-01T05:00:00.401Z",
  "user": {
    "email": "john.doe@example.com",
    "id": "user_xxxxxxxxxxxxx",
    "name": "John Doe",
    "username": "johndoe42"
  }
}

Changes