Create membership
civicrm_create_membershipCreate a membership record for a contact. CiviCRM automatically calculates start and end dates from the membership type duration when omitted.
Instructions
Create a Membership record for a contact. CiviCRM will auto-calculate start/end dates from the membership type's duration if omitted. Requires CIVICRM_ALLOW_WRITES=true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| extra | No | ||
| source | No | ||
| status | No | Membership status name, e.g. 'New', 'Current', 'Grace', 'Expired'. | New |
| end_date | No | ISO date. If omitted, CiviCRM calculates from the type's duration. | |
| join_date | No | ISO date (YYYY-MM-DD). Defaults to today. | |
| contact_id | Yes | ||
| start_date | No | ISO date. If omitted, CiviCRM calculates from the type's duration. | |
| membership_type | Yes | Membership type name, e.g. 'General', 'Student', 'Lifetime'. |