Purchase Subscription
This API allows third-party platforms (e.g., middleware that interfaces with the mobile app of the business) to purchase a new subscription plan in the Punchh platform without the need for guests to be logged in to the Punchh platform.
If a business is migrating active subscriptions from an incumbent system to the Punchh platform, the subscription ID for each user in the incumbent system can be mapped to the corresponding subscription ID 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
Content - Type requiredapplication/json
- Type: string
Accept requiredapplication/json
- Type: string
Authorization requiredBearer token for admin authorization, who is making a call on behalf of the customer
- 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".
- 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: numberFormat: float
initial _debits Number of discounted units for the migrated subscription. Based on this value, further discounting of units will be done in the Punchh system after the guest migrates. This value should not be included in lifetime_debits and should be sent only once at the time of making the purchase call for migration. This is relevant only if the value of the "migration" parameter is "true".
- Type: numberFormat: float
initial _savings Volume of savings for the migrated subscription. Further savings in the Punchh platform will be added to this. This value should not be included in lifetime_savings and should be sent only once at the time of making the purchase call for migration. This is relevant only if the value of the "migration" parameter is "true".
- Type: numberFormat: float
lifetime _debits Total discounted units under this plan ID, issued in the incumbent system before the guest migrated over to Punchh. This value should be sent only once at the time of making the purchase call for migration. This is relevant only if the value of the "migration" parameter is "true".
- Type: numberFormat: float
lifetime _savings Total volume of savings under this plan ID, issued in the incumbent system before the guest migrated over to Punchh. This value should be sent only once at the time of making the purchase call for migration. This is relevant only if the value of the "migration" parameter is "true".
- 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: boolean
migration default:falseThis key determines if a particular purchase call should be considered as a fresh purchase or the migration of an existing subscription from the incumbent system to the Punchh platform. A value of "true" indicates that this purchase is a migration, and value of "false" indicates that this is a fresh purchase.
- Type: integerFormat: int64
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 charged to the user for purchasing the subscription plan
- Type: integerFormat: int64
source _subscription _id This key should be sent if the purchase call is being made because a guest decides to change the subscription plan. In all other cases, this key should be sent as null.
- 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
201 - Type: string
end _time min length:1Format: date-timerequiredDate and time (in ISO 8601 format) until 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: integerFormat: int64
subscription _id requiredSystem-generated unique ID of the subscription that is issued for a guest
- Type: object
400 - Type: string
error
- Type: object
401 - Type: string
error min length:1required
- Type: object
406 - Type: string
invalid min length:1
- Type: object
422 - Type: object
errors
{
"subscription_id": 123,
"start_time": "2021-05-18 11:34:46",
"end_time": "2021-05-28 11:34:46",
"external_plan_identifier": "string",
"location_id": 1
}