post-api2-mobile-subscriptions

Fetch Active Purchasable Subscription Plans

This API returns all of the active subscription plans that are purchasable using the mobile app and have their end time in the future.

Headers
  • Accept-Language
    Type: string

    Preferred language. Punchh supports multiple languages for the subscription plan name, description, and miscellaneous parameters in the API response as per the locale specified in the Accept-Language request header. Possible values: es for Spanish, fr for French, fr-ca for French-Canada, en-CY for English-Cyprus, ro for Romania, es-US for Spanish United States, etc. The locales for a business are configured in the Punchh platform under Administration > Business Profile > Address > Alternate Languages. Administrators have to configure Name, Description, and Miscellaneous fields in the relevant language(s) on the subscription plan in the Punchh platform under Wallet and Passes > Subscription Plans. If these fields are not configured in Punchh in the language specified in the Accept-Language request header, then the API response will include the subscription plan name, description, and miscellaneous parameters with empty values.

  • x-pch-digest
    Type: string
    required

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

  • 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

Body
application/json
  • client
    Type: string

    OAuth client ID provided by the business

Responses
  • 200
    Type: array object[] 1… unique!

    Success response if the business supports subscriptions

    • active_subscribers
      Type: number

      Number of unique active subscribers of the plan

    • auto_renewing
      Type: boolean

      Determines whether a subscription issued from a subscription plan is an auto-renewal plan or a single-use subscription plan, such as a seasonal pass. A true value means the subscription plan gets automatically renewed, and a false value means the subscription plan is a single-use plan. The mobile application uses this value to determine if the auto_renewal of a subscription should be sent as true or false with the Purchase Subscription API call.

    • description
      Type: string

      Text description of the subscription plan as configured by an admin on the subscription plan. This is used to explain the offerings of the subscription plan to guests.

      Note: The subscription description is returned in the language specified in the Accept-Language request header, provided the description has been translated into the relevant language in the Punchh platform. If the translation is not available, then no value is returned for this parameter in the API response. For example, if the header specifies “fr” (French), the subscription description is returned in French only if a French translation for the description is configured in the Punchh platform.

    • end_time
      Type: string
      min length:  
      1
      Format: date-time

      Date and time (in ISO 8601 format) until which the subscription plan can be purchased by guests

    • external_plan_identifier
      Type: string

      UPC/SKU of the subscription plan as present on third-party applications of enterprise businesses and is configured on this subscription plan. This will be stored in the database, and the business can use it for analytics purposes.

    • image
      Type: string
      min length:  
      1

      Cover image of a subscription plan uploaded at the time of subscription plan creation

    • miscellaneous
      Type: string

      Free-form text field that can be used by businesses to enter additional information or a JSON code snippet for greater customization in the mobile app

      Note: The subscription miscellaneous information is returned in the language specified in the Accept-Language request header, provided it has been translated into the relevant language in the Punchh platform. If the translation is not available, then no value is returned for this parameter in the API response. For example, if the header specifies “fr” (French), the subscription miscellaneous information is returned in French only if a French translation for the miscellaneous is configured in the Punchh platform.

    • name
      Type: string
      min length:  
      1

      Name of the subscription plan as provided by an admin at the time of subscription plan creation

      Note: The subscription nameis returned in the language specified in the Accept-Language request header, provided the name has been translated into the relevant language in the Punchh platform. If the translation is not available, then no value is returned for this parameter in the API response. For example, if the header specifies “fr” (French), the subscription name is returned in French only if a French translation for the name is configured in the Punchh platform.

    • plan_id
      Type: integerFormat: int64

      System-generated unique ID of a subscription plan created in the Punchh platform

    • plan_image_url
      Type: string

      URL of the image that is configured for a specific subscription plan

    • purchase_price
      Type: numberFormat: float

      Cost of purchase of one unit of a subscription plan

    • signup_end_date
      Type: string
      min length:  
      1
      Format: date-time

      Date and time (in ISO 8601 format) after which the subscription plan cannot be purchased by guests. This is the purchase cut-off time, and a business can use it to nudge guests into purchasing a subscription.

    • signup_start_date
      Type: stringFormat: date-time

      Date and time (in ISO 8601 format) after which the subscription plan can be purchased by guests in advance. This can be used by businesses to make a plan available for purchase before it actually starts. Any subscriptions bought after this date and before the start date of the subscription plan will start from the start_time of the Subscription Plan.

    • start_time
      Type: string
      min length:  
      1
      Format: date-time

      Date and time (in ISO 8601 format) from which the subscription plan can be purchased by guests

    • subscriber_capping
      Type: number

      Maximum number of unique active subscribers for a plan. If the number of active subscribers reaches this limit, fresh purchases in that plan will be stopped.

    • timezone
      Type: string

      Time zone configured on the subscription plan (e.g., "America/Los_Angeles” )

    • validity
      Type: integerFormat: int32

      Number of days for which one unit of the subscription plan remains valid after purchase

  • 400
    Type: object
    • errors
      Type: object
      required
  • 412
    Type: object
    • errors
      Type: object
  • 422
    Type: object
    • errors
      Type: object
get/api2/mobile/subscriptions
[
  {
    "name": "string",
    "description": "string",
    "miscellaneous": "string",
    "validity": 30,
    "start_time": "2021-04-28T13:59:47+05:30",
    "end_time": "2021-04-28T13:59:47+05:30",
    "signup_start_date": "2023-04-28T13:59:47+05:30",
    "signup_end_date": "2021-04-28T13:59:47+05:30",
    "external_plan_identifier": "string",
    "plan_id": 10,
    "plan_image_url": "string",
    "purchase_price": 12.32,
    "image": "test-image.png",
    "subscriber_capping": 400,
    "active_subscribers": 251,
    "timezone": "string",
    "auto_renewing": true
  }
]