Gift a Gift Card

​

Enables a user to gift a gift card to another user. If the gift card gifting feature is disabled for the brand in the Punchh platform, the API returns a 422 error. Contact your Punchh representative to update this Punchh platform configuration.

Headers

  • The signature for the API call

  • Used to authorize the request with access_token. It should be supplied as Bearer ACCESS_TOKEN_GOES_HERE.

  • Set this header to application/json.

  • Preferred language

  • Advertises which content types the client is able to understand

  • Used to identify the software, device, and application initiating the request, providing information about the client to the server. For details, see User Agent.

Body

application/json
  • OAuth client ID provided by the business

  • Monetary value of the gift card

  • Name of the person who owns the payment card used to purchase the gift card

  • Identification of a particular gift card design selected by the user while gifting a gift card

  • Expiration date of the payment card used by the user

  • This parameter is required when a user makes a payment via saved cards. Send "recurring" as the value of this parameter.

  • Email address of the user who will receive the gift card. At least one of the three (i.e., recipient_email, recipient_phone, and recipient_fb_uid) should be provided. If more than one are provided as parameters, the system will identify that user for whom all of the provided parameters match.

  • Facebook "uid" of the user who will receive the gift card. At least one of the three (i.e., recipient_email, recipient_phone, and recipient_fb_uid) should be provided. If more than one are provided as parameters, the system will identify that user for whom all of the provided parameters match.

  • Phone number of the user who will receive the gift card. At least one of the three (i.e., recipient_email, recipient_phone, and recipient_fb_uid) should be provided. If more than one are provided as parameters, the system will identify that user for whom all of the provided parameters match.

  • Unique digital identifier/token of the user's payment card, or the UUID of the saved payment card if the value of payment_type is "recurring". The transaction token is issued by a payment processor used by a business.

  • Type of payment card used by the user (e.g., Visa, Mastercard, etc.).

Responses

  • text/plain
  • Please turn on <config_key> in Mobile Configuration before performing this gift card action.

Request Example for post/api2/mobile/gift_cards/gift
curl https://SERVER_NAME_GOES_HERE.punchh.com/api2/mobile/gift_cards/gift \
  --request POST \
  --header 'x-pch-digest: {{$$.env.signature}}' \
  --header 'Authorization: Bearer ACCESS_TOKEN_GOES_HERE' \
  --header 'Content-Type: application/json' \
  --header 'Accept-Language: en' \
  --header 'Accept: application/json' \
  --header 'User-Agent: AppName/AppVersion/BuildNumber (OS; Model; MANUFACTURER; MODEL; OS Version)' \
  --data '{
  "recipient_email": "test@example.com",
  "recipient_phone": 1111111111,
  "recipient_fb_uid": "FB_UID_GOES_HERE",
  "client": "CLIENT_GOES_HERE",
  "amount": "28",
  "design_id": "1",
  "transaction_token": "TOKEN_GOES_HERE",
  "cardholder_name": "FIRST_NAME_GOES_HERE LAST_NAME_GOES_HERE",
  "exp_date": 418,
  "type": "VISA"
}'
[
  "Whoa! You are one generous burrito stuffed amigo, with your gift of $28.00 to <user>."
]