Purchase Subscription
This API supports the purchase of a subscription plan created in the Punchh platform.
If the Single Use setting is enabled for the subscription plan, and if you send auto_renewal as true in the Purchase Subscription API, then the API returns an error: This is a single use subscription and cannot be renewed automatically. Please check the request to send auto_renewal as false.
- Type: string
Accept requiredAdvertises which content types the client can understand
- Type: string
Content - Type requiredSet this header to application/json
- Type: string
x -pch -digest requiredSignature generated using the request path, body, and OAuth secret provided by the business. For details, see signature.
- Type: string
Authorization requiredUsed to authorize the request with access_token. It should be supplied as
Bearer ACCESS_TOKEN_GOES_HERE. Note: When authentication is performed using Advanced Authentication, you must include theid_tokenin theid-tokenheader and theaccess_tokenin theAuthorizationheader. See Access Punchh APIs Using Access and ID tokens - Type: string
Accept - Language Preferred language
- Type: string
User - 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: string
id -token 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_tokenin theid-tokenheader and theaccess_tokenin theAuthorizationheader. See Access Punchh APIs Using Access and ID tokens
- Type: boolean
auto _renewal default:falserequiredA guest’s preference of having a newly purchased subscription plan get automatically renewed per the plan's schedule. Third parties where auto renewal is considered default should send this value as "true". The mobile application uses the value in the auto_renewing response parameter in the Fetch Active Purchasable Subscription Plans API to determine if the auto-renewal of a subscription should be sent as true or false during the subscription purchase.
- Type: string
client requiredOAuth client ID provided by the business
- Type: string
end _time min length:1Format: date-timerequiredDate and time (in ISO 8601 format) until which the subscription being issued will remain active
- Type: string
external _plan _identifier 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. This value can be used to make the purchase of the subscription plan instead of using the “plan_id”.
- Type: integer
location _id requiredID of the location where the subscription plan is purchased. It identifies the origin of the subscription purchase for the loyalty guest. If an invalid or missing location_id is passed, the API returns a 400 Bad Request error with the message "Invalid or missing location_id".
- Type: string
payment _card _uuid Unique digital identifier/token of the user's credit card can be referred to as the uuid of the saved payment card, required if a saved payment card is used for payments. The transaction token is issued by a payment processor used by a business.
- Type: integer
plan _id requiredSystem-generated unique ID of a subscription plan created in the Punchh platform. A subscription based on this plan ID will be issued to the guest when a purchase call is made.
- Type: numberFormat: float
purchase _price requiredPrice at which one unit of the subscription plan is purchased
- Type: string
start _time min length:1Format: date-timerequiredDate and time (in ISO 8601 format) from which the subscription being issued will become active
- Type: object
200 - Type: string
end _time min length:1Format: date-timerequiredDate and time (in ISO 8601 format) until which the subscription plan purchased for the guest will remain active
- Type: string
external _plan _identifier 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.
- Type: integer
location _id ID of a valid Punchh location where the subscription plan is purchased. It identifies the origin of the subscription purchase for the loyalty guest. If an invalid or missing location_id is passed, the API returns a 400 Bad Request error with the message "Invalid or missing location_id".
- Type: string
start _time min length:1Format: date-timerequiredDate and time (in ISO 8601 format) from which the subscription plan purchased for the guest will become active
- Type: integer
subscription _id requiredSystem-generated unique ID of the subscription plan that is issued for a guest
- Type: object
400 - Type: object
errors required
- Type: object
401 - Type: object
errors required
- Type: object
412 - Type: object
errors required
- Type: object
422 - Type: object
errors required
{
"subscription_id": 1,
"start_time": "2021-04-28T13:59:47+05:30",
"end_time": "2021-04-28T13:59:47+05:30",
"external_plan_identifier": "string",
"location_id": 1
}