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.

Headers
  • User-Agent
    Type: string
    required

    Used to identify the software, device, and application initiating the request, providing information about the client to the server. For details, see User Agent.

  • Accept
    Type: string
    required

    Advertises which content types the client can understand

  • Accept-Language
    Type: string

    Preferred language

  • Content-Type
    Type: string
    required

    Set this header to application/json

  • Authorization
    Type: string
    required

    Used to authorize the request with access_token. It should be supplied as Bearer ACCESS_TOKEN_GOES_HERE.

  • x-pch-digest
    Type: string
    required

    Signature generated using the request path, body, and OAuth secret provided by the business. For details, see signature.

Body
application/json
  • cancellation_feedback
    Type: string
    required

    Subjective feedback that can be captured from guests when they cancel a subscription from the mobile application. The maximum length supported is 225 characters.

  • cancellation_reason_id
    Type: integer
    required

    Unique 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.

  • client
    Type: string
    min length:  
    1
    required

    OAuth client ID provided by the business

  • subscription_id
    Type: string
    required

    System-generated unique ID of the subscription of the guest that needs to be cancelled

Responses
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for put/api2/mobile/subscriptions/cancel
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."
]