Cancel Subscription (Turn off Auto Renewal)
This API allows the user to cancel an active subscription (turn off auto renewal for the subscription). This is a soft cancellation wherein the benefits remain valid until the end time of the subscription.
- Type: stringUser
- Agent requiredUsed to identify the software, device, and application initiating the request, providing information about the client to the server. For details, see User Agent.
- Type: stringAcceptrequired
Advertises which content types the client can understand
- Type: stringAccept
- Language Preferred language
- Type: stringContent
- Type requiredSet this header to application/json
- Type: stringAuthorizationrequired
Used to authorize the request with access_token. It should be supplied as
Bearer ACCESS_TOKEN_GOES_HERE. - Type: stringx
-pch -digest requiredSignature generated using the request path, body, and OAuth secret provided by the business. For details, see signature.
- Type: stringcancellation
_feedback requiredSubjective feedback that can be captured from guests when they cancel a subscription from the mobile application. The maximum length supported is 225 characters.
- Type: integercancellation
_reason _id requiredUnique ID of the business-configured cancellation reason that a guest selects when cancelling a subscription. You can find cancellation reason IDs under the subscriptions object in the Program Meta API response.
- Type: stringclientmin length:1required
OAuth client ID provided by the business
- Type: stringsubscription
_id requiredSystem-generated unique ID of the subscription of the guest that needs to be cancelled
- application/json
- application/json
- application/json
- application/json
- application/json
curl https://SERVER_NAME_GOES_HERE.punchh.com/api2/mobile/subscriptions/cancel \
--request PUT \
--header 'User-Agent: AppName/AppVersion/BuildNumber (OS; Model; MANUFACTURER; MODEL; OS Version)' \
--header 'Accept: application/json' \
--header 'Accept-Language: en' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ACCESS_TOKEN_GOES_HERE' \
--header 'x-pch-digest: ' \
--data '{
"subscription_id": "1",
"cancellation_feedback": "",
"cancellation_reason_id": 1
}'
[
"Subscription auto renewal canceled."
]