Send OTP
Triggers an email or SMS to send an OTP (One-Time Password) depending on the communication channel (Email, SMS or both) configured for the business on the Punchh platform.
Prerequisites
The Advanced Authentication feature must be enabled for the business in the Punchh platform; otherwise, the API request will return an error. Contact your Punchh representative for more information about this Punchh platform configuration.
For more information, see Advanced Authentication.
- Type: string
Accept requiredAdvertises which content types the client is able to understand
- Type: string
User - Agent requiredFor details, see User Agent.
- Type: string
Content - Type requiredSet this header to application/json
- Type: string
punchh -app -device -id requiredThe app device ID helps Punchh identify each device so that certain rewards can be awarded individually to each device instead of per user. For example, the sign-up reward is given to each device ID to prevent fraudulent sign-ups so that a user cannot do repeated sign-ups from a single device to get rewards. It should not change even if the user resets a device. See the sample code to generate the punchh-app-device-id header.
- If the email address or phone number is not provided, the API returns a communication channel missing error when both communication channels are enabled for the business.
- If the phone number is provided but phone is not enabled as a communication channel for the business, the API returns a parameter missing error for phone.
- If the email address is provided but the email is not enabled as a communication channel for the business, the API returns a parameter missing error for email.
- If the validation method enabled for the business is not provided in the request, the API returns a validation method missing error for the validation method that is enabled.
Contact your Punchh representative for more information about these Punchh platform configurations.
- Type: string
client requiredOAuth client ID provided by the business
- Type: string
code _challenge requiredThe base64url-encoded SHA-256 hash of the
code_verifier, a random string generated by the mobile or online app. See PKCE Flow for details. - Type: string
email Email address of the user where the OTP will be sent. Either
emailorphoneis required. - Type: string
phone _ext Value represents the country code enabling support for international phone numbers. It should be preceded by a +, i.e. +1 (Country code for the US and Canada).
- Type: string
phone _number Phone number of the user where the OTP will be sent. Either
emailorphoneis required. Providing an incorrect phone number results in an undelivered SMS message. - Type: boolean
privacy _policy requiredIndicates whether the user has agreed to the business's privacy policy. Possible values: true, false. This parameter must be set to "true" for a successful API call. If the parameter is not specified or set to "false", the API returns a 422 error with the message: "Please agree on given privacy policy".
- Type: boolean
terms _and _conditions requiredIndicates whether the user has accepted the business’s terms and conditions. Possible values: true, false. This parameter must be set to "true" for a successful API call. If the parameter is not specified or set to "false", the API returns a 422 error with the message: "Please agree on given terms and conditions".
- Type: string
validation _method Method used to validate the user. Possible values: otp
- Type: object
200 - Type: object
data
- Type: object
400 - Type: object
errors
- Type: object
404 - Type: object
errors
- Type: object
412 - Type: object
errors
- Type: object
422 - Type: object
errors
- Type: object
503 - Type: object
errors
{
"data": {
"message": [
"string"
]
}
}