create_api2-mobile-payment_cards

Create a Payment Card

Creates and saves a payment card for a user. This API is triggered when the user saves the payment card on the mobile application.

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

  • Accept
    Type: string
    required

    Advertises which content types the client is able to understand

  • 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
  • adapter_code
    Type: string
    required

    Name of the payment processor / payment gateway. Valid values are heartland and par_payment.

  • billing_info
    Type: object

    Billing information of the cardholder

  • client
    Type: string
    required

    OAuth client ID provided by the business

  • nickname
    Type: string

    Payment card nickname, as set by the user

  • preferred
    Type: boolean

    This value determines whether this card will be selected as the default card or not when the user makes a payment through the mobile application. If the value is set to true, this card will be selected as the default card for payments. Valid values are true or false.

  • transaction_token
    Type: string
    required

    Unique digital identifier/token of the user's payment card provided by the payment processor

Responses
  • 200
    Type: object
    • card_details
      Type: object

      User's saved payment card details

    • nickname
      Type: string

      Saved payment card nickname, as set by the user

    • preferred
      Type: boolean

      This value determines whether this saved payment card will be selected as the default card or not when the user makes a payment through the mobile application. If the value is set to true, this card will be selected as the default card for payments. Valid values are true or false.

    • uuid
      Type: string

      Saved payment card UUID

  • 400
    Type: object
    • errors
      Type: object
  • 401
    Type: object
    • errors
      Type: object
  • 422
    Type: object
    • errors
      Type: string
post/api2/mobile/payment_cards
{
  "uuid": "string",
  "nickname": "string",
  "preferred": true,
  "card_details": {
    "name_on_card": "string",
    "card_type": "string",
    "cc_4": "string",
    "expiry_month": "string",
    "expiry_year": "string"
  }
}