mobile_gen_ssc

Generate a Single Scan Code

This API facilitates the single-scan flow functionality, allowing a user to generate a single-scan code from the mobile app for making a payment, redeeming a discount, adding a tip, or any combination of these in a single transaction at the POS. The API returns a single scan code containing a UUID string in the response.

For more information, see Single Scan Flow.

Note: This mobile API endpoint (POST {server-name}/api2/mobile/single_scan_tokens) is the same as the mobile API endpoint used to generate a one-time passcode (OTP) for use with Redemptions 2.0. When using this API with Redemptions 2.0, the following offers parameters must NOT be included with the request body:

  • reward_id
  • redeemable_id
  • banked_reward_amount
  • coupon
  • redeemable_card_count
  • subscription_id
Headers
  • x-pch-digest
    Type: string
    required

    The signature for the API call

  • Content-Type
    Type: string
    required

    Set this header to application/json.

  • Accept-Language
    Type: string

    Preferred language

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

  • punchh-app-device-id
    Type: string
    required

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

  • Authorization
    Type: string
    required

    Used 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 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
  • banked_reward_amount
    Type: string

    Amount of banked currency selected by the user for redemption

  • client
    Type: string
    required

    OAuth client ID provided by the business

  • coupon
    Type: string

    User-specific dynamically generated unique coupon codes that the POS system automatically applies in a single scan, or a comma-separated list of unique coupons if multiple coupons are selected by the user for redemption

  • gift_card_uuid
    Type: string

    The user's gift card number. Required if the payment type is gift card.

  • payment_type
    Type: string

    Payment type selected by the user when generating the single scan code. Valid values are GiftCard, CreditCard, or recurring. The payment type is recurring when the user selects a saved payment card from the mobile application for payments.

  • redeemable_card_count
    Type: string

    Number of redeemable cards selected by the user for redemption

  • redeemable_id
    Type: string

    Unique ID of a redeemable, or a comma-separated list of redeemable IDs if multiple redeemables are selected by the user for redemption

  • reward_id
    Type: string

    Unique ID of a reward, or a comma-separated list of reward IDs if multiple rewards are selected by the user for redemption

  • subscription_id
    Type: string

    Unique ID of a subscription, or a comma-separated list of subscription IDs if multiple subscriptions are selected by the user for redemption

  • tip
    Type: string

    Amount that the user selected as a tip

  • transaction_token
    Type: string

    Unique digital identifier/token of the user's credit card, or UUID of the saved payment card if the payment type is recurring. Required if the payment type is credit card or recurring.

Responses
  • 200
    Type: object
    • created_at
      Type: string

      Date/time when the single scan code was created in the system, in ISO 8601 format

    • expires_in
      Type: string

      Date/time when the single scan code expires and the user cannot use it at the POS, in ISO 8601 format

    • single_scan_code
      Type: string

      Single scan code of the user to be used in single scan flow at the POS

  • 400
    Type: object
    • errors
      Type: object
  • 401
    Type: object
    • errors
      Type: object
  • 422
    Type: object
    • errors
      Type: string
post/api2/mobile/single_scan_tokens
{
  "single_scan_code": "string",
  "expires_in": "string",
  "created_at": "string"
}