Create Membership
POST /customers/:customerId/memberships
You can post a new membership by providing the following fields:
| Property | Type | Description |
|---|---|---|
membershipTypeId* | string (UUIDv4) | ID of membership type |
validFrom | string (YYYY-MM-DD) | Date for when the membership should be valid from. If not provided, it will be set to the current date. |
validTo | string (YYYY-MM-DD) | Date for when the membership should be valid to. If not provided, it will be set to the current date + the cycle of the membership type. |
previousMembershipId | string (UUIDv4) | If the membership is a renewal, then this field should be set to the id of the previous membership. |
payerId | string (UUIDv4) | If the membership is paid by another customer, then this field should be set to the id of the payer. It is returned as payerId on the membership, and the membership is listed in the payer's paidMemberships. The payer must be a customer of your organization, not deleted, in the same mode (live or test) as your key; otherwise the request fails with 400 and PAYER_NOT_FOUND. It is not copied from previousMembershipId, so pass it again on a renewal. |
origin | string | Optional origin of the membership. Returned nested on membershipType.origin when you read the membership. |