Cancel Subscription (Turn off Auto Renewal)

This API allows the end 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
  • Accept
    Type: string
    required

    Advertises which content types the client can understand

  • Content-Type
    Type: string
    required

    Set this header to application/json

  • x-pch-digest
    Type: string
    required

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

  • Accept-Language
    Type: string

    Language parameter

  • Authorization
    Type: string
    required

    You may pass the access_token instead of the authentication_token in Online Ordering endpoints to authorize the request. It must be supplied as Bearer ACCESS_TOKEN_GOES_HERE.

Body
application/json
  • cancellation_feedback
    Type: string
    min length:  
    1
    required

    Reason for cancelling the subscription as provided by the end user

  • cancellation_reason_id
    Type: string
    required

    ID of the chosen cancellation reason. You can get this value from the subscription_cancellation_reasons object returned in the response of a successful Subscription Meta API call.

  • cancellation_type
    Type: string
    min length:  
    1
    enum
    required

    Type of cancellation -- either "hard_cancelled" or "soft_cancelled". If “soft_cancelled”, end users can enjoy the benefits until the “end_time” of the subscription. If “hard_cancelled”, subscription benefits are terminated immediately.

    values
    • hard_cancelled
    • soft_cancelled
  • client
    Type: string
    min length:  
    1
    required

    OAuth client ID provided by the business (per the OAuth app in the Punchh platform)

  • subscription_id
    Type: integer
    required

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

  • authentication_token
    Type: string

    The authentication token of the user. You can retrieve this from the response of a successful sign-in API call or through the SSO process.

Responses
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for put/api/auth/subscriptions/cancel
curl https://SERVER_NAME_GOES_HERE.punchh.com/api/auth/subscriptions/cancel \
  --request PUT \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header 'x-pch-digest: ' \
  --header 'Accept-Language: en' \
  --header 'Authorization: Bearer ACCESS_TOKEN_GOES_HERE' \
  --data '{
  "client": "CLIENT_GOES_HERE",
  "subscription_id": 24,
  "cancellation_feedback": "Price too High.",
  "cancellation_reason_id": "1",
  "cancellation_type": "soft_cancelled"
}'
{
  "message": "Subscription auto renewal cancelled"
}