Create Transaction
Use the Create Transaction API to create a transaction for a customer (provided this functionality is enabled for the business by Punchh). The transaction registers the visit of the customer at a certain store, but the customer will not earn loyalty (points, etc.). One of the identifiers (email, phone, card_number, user_as_qrcode, single_scan_token or redemption_code) must be provided along with location_key.
Headers
- Type: stringAuthorizationrequired
This is a combination of unique API key as well as business key (UUID) as the Authorization header.
- Type: stringAccept
- Language Short code for locale variant (e.g., fr-ca, es-ES, en-EN, etc.)
Body
- Type: numberFormat: doubleamountrequired
Order amount before any taxes (sum of all amounts minus any discounts). Same as
receipt_amountandsubtotal_amount. - Type: stringchannelrequired
Channel through which the check-in was requested. Possible values are: online_order, pos, web, mobile, dashboard, chatbot, kiosk.
- Type: stringemailrequired
Email address of the user
- Type:requiredProperties: 8
The array contains one or more menu item objects added to an order. You send one of these arrays per API call. See How To Send Menu Items to Punchh
- Type: numberFormat: doublepayablerequired
Amount paid after applying discounts and adding any taxes or service charges. For example, if the order amount is $10, the values of the
receipt_amountandsubtotal_amountparameters will be $10. If a $2 discount is applied,subtotal_amountbecomes $8. However, if there are $3 service charges and $1 tax, the value of thepayableparameter becomes $12 (10 – 2 + 3 + 1 = 12). - Type: stringpunchh
_key requiredUnique Punchh key
- Type: numberFormat: doublereceipt
_amount requiredOrder amount before taxes, calculated as the sum of
item_amountforMline items inmenu_itemsminus theitem_amountforDline items;S,T, andPline items are excluded. See the description of theD,S,T, andPitems in themenu_items.menu_item_typerequest parameter. The value of this parameter should matchsubtotal_amount. - Type: stringFormat: date-timereceipt
_datetime requiredTimestamp of receipt per ISO 8601 format including TZ offset from UTC (YYYY-MM-DDThh:mm:ss-±hh:mm)
- Type: numberFormat: doublesubtotal
_amount requiredOrder amount before taxes, calculated as the sum of
item_amountforMline items inmenu_itemsminus theitem_amountforDline items;S,T, andPline items are excluded. See the description of theD,S,T, andPitems in themenu_items.menu_item_typerequest parameter. Same asreceipt_amount. For historical reasons, include this parameter along withreceipt_amountin the API request. - Type: integertransaction
_no requiredTrasaction number
- Type: stringcard
_number Loyalty card number of the user
- Type: integercc
_last4 Last 4 digits of the user's credit card number
Responses
- application/json
curl https://SERVER_NAME_GOES_HERE.punchh.com/api/pos/transactions \
--request POST \
--header 'Authorization: Token token=LOCATION_KEY_GOES_HERE, btoken=BUSINESS_KEY_GOES_HERE' \
--header 'Accept-Language: en' \
--header 'Content-Type: application/json' \
--data '{
"email": "test@example.com",
"receipt_amount": 40,
"receipt_datetime": "2018-12-17T03:14:00-08:00",
"sequence_no": 12345,
"punchh_key": "PUNCHH_KEY_GOES_HERE",
"transaction_no": 3502723201,
"subtotal_amount": 40,
"channel": "pos",
"revenue_id": "Dine In",
"revenue_code": "4",
"employee_id": "135",
"employee_name": "EMPLOYEE_NAME_GOES_HERE",
"payable": 44.5,
"menu_items": [
{
"item_name": "REG SIERRA MIST",
"item_qty": 1,
"item_amount": 40,
"menu_item_type": "M",
"menu_item_id": "2032",
"menu_family": "106",
"menu_major_group": "152",
"serial_number": "1"
}
]
}'
{
"anniversary": null,
"avatar_remote_url": "URL_GOES_HERE",
"birthday": "1999-01-01",
"created_at": "2012-11-21T10:52:32Z",
"email": "test@example.com",
"fb_uid": "FB_UID_GOES_HERE",
"first_name": "FIRST_NAME_GOES_HERE",
"gender": "male",
"id": 542057,
"last_name": "LAST_NAME_GOES_HERE",
"updated_at": "2015-05-15T18:53:38Z",
"balance": {
"banked_rewards": "259.00",
"membership_level": "CAPADDICT",
"membership_level_id": 16,
"membership_program_id": null,
"net_balance": 259,
"net_debits": 0,
"pending_points": 0,
"points_balance": 59,
"signup_anniversary_day": "05/06",
"total_credits": 259,
"total_debits": 0,
"total_point_credits": 185,
"total_redeemable_visits": 12,
"expired_membership_level": "CAPREHENSIVE",
"total_visits": 8
},
"address_line1": null,
"zip_code": null,
"phone": null,
"rewards": [
{
"created_at": "2015-05-08T13:30:18Z",
"end_date_tz": "2016-05-08T06:59:59Z",
"start_date_tz": "2015-05-07T18:30:00Z",
"updated_at": "2015-05-08T13:30:18Z",
"id": 619162,
"image": "IMAGE_URL_GOES_HERE",
"description": "Happy Birthday! Here's a 9\" Sub for you to enjoy.",
"discount_amount": 0,
"name": "9\" Sub!",
"points": 0
}
]
}