put-api-auth-subscriptions

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. Note: When authentication is performed using Advanced Authentication, you must include the id_token in the id-token header and the access_token in the Authorization header. See Access Punchh APIs Using Access and ID tokens

  • id-token
    Type: string

    A token that contains identity information about the authenticated user. It is used to verify the user’s identity and is required only when authentication is performed using Advanced Authentication. This token alone does not grant access to Punchh APIs. To access the APIs, you must include the id_token in the id-token header and the access_token in the Authorization header. See Access Punchh APIs Using Access and ID tokens

Body
application/json
  • 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.

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

    • 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

Responses
  • 200
    Type: object
    • message
      Type: string
      min length:  
      1
      default: 
      "Subscription auto renewal cancelled"
      required
  • 400
    Type: object
    • error
      Type: string
  • 401
    Type: object
    • error
      Type: string
  • 412
    Type: array object[]

    Precondition Failed: Sending an invalid/empty client

    Invalid Signature means the signature generated at the Punchh Server for the API call does not match the signature generated by the client. See Generating x-pch-digest Header for Online Ordering APIs

  • 422
    Type: object
    • error
      Type: object
put/api/auth/subscriptions/cancel
{
  "message": "Subscription auto renewal cancelled"
}