DELETE Membership (CancelMembership)
External Membership API
Overview
Method | API Endpoint | Description |
DELETE | /api/v{version}/membership | Cancels an existing membership at club level as well as from branch level (sports). If branchId is passed in the request then the API cancels branch level membership, otherwise it cancels the Club level membership.
Allidrett: Allidrett memberships (group level) can be cancelled using this API. Pass the allidrett groupID to cancel the allidrett group membership. Today’s date will be passed as end date for canceled memberships. |
Resource Information
Response Format | JSON |
Requires Authentication | Yes |
Request Headers
| Name | Required | Description |
1 | ClubId | Yes | Club Id for which API is being requested |
2 | Authorization | Yes | This will be the token to define access for on-boarded club. |
3 | Ocp-Apim-Subscription-Key | Yes | API management’s subscription key. There will be separate key for each 3.party. |
Request Parameters
| Name | Required | Description | Example |
1 | PersonId | Mandatory | Person Id | 5347891 |
2 | BranchId | Optional | If Branch Id is passed in the request then the API cancels the branch level membership, otherwise it cancels the Club level membership. | 1238 |
3 | IsClubLevel | Optional | If true, the system deletes club level membership, and Branch Id should not be passed.
| True
|
4 | GroupId | Optional | If group Id is passed in the request then the API cancels the group level membership, otherwise it cancels the Club level membership. | 1238 |
Request Example
{ "personId": 5347891, "endDate": "2017-06-20", “branchId”: 1238 }
Response Example
"Club level membership cancellation request accepted for {personId} with {clubId}." Or "Branch level membership cancelled for {personId} with {branchId}." |
Corporate Sports API
Overview
Method | API Endpoint | Description |
DELETE | /api/v{version}/membership | Cancels an existing membership at Corporate Sports club level as well as from Group level. If Group Id is passed in the request then the API cancels Group level membership, otherwise it cancels the Corporate Sports Club level membership. Today’s date will be passed as end date for canceled memberships. |
Resource Information
Response Format | JSON |
Requires Authentication | Yes |
Request Headers
| Name | Required | Description |
1 | ClubId | Yes | Club Id for which API is being requested. Pass Corporate Sport club’s ID to delete membership for Corporate sports club or group of corporate club. |
2 | Authorization | Yes | This will be the token to define access for on-boarded club. |
3 | Ocp-Apim-Subscription-Key | Yes | API management’s subscription key. There will be separate key for each 3.party. |
Request Parameters
| Name | Required | Description | Example |
1 | PersonId | Mandatory | Person Id | 5347891 |
2 | GroupId | Optional | If Group Id is passed in the request then the API cancels the Group level membership, otherwise it cancels the Corporate Sports Club level membership. | 1238 |
3 | IsClubLevel | Optional | If true, the system deletes club level membership, and Group Id should not be passed.
| true |
Response Codes
| Code | Text |
1 | 200 |
|
2 | 1002 | Invalid PersonId |
3 | 1019 | Please provide Either Club Id or Group Id to identify Club level or Group level membership delete request. |
4 | 1021 | No Corporate Sports club level membership found for delete. |
5 | 1041 | Branch level membership for Corporate Club is not allowed. |
6 | 1044 | Invalid Corporate Club Group Id. |
7 | 1047 | No group level membership found for delete. |
Request Example
{ "personId": 5347891, "endDate": "2017-06-20", "groupId": 1238 }
Response Example
{ "message": "Club level membership cancellation request accepted for 9289406 with 16235.", "updatedPersonId": 9289406 }