Fetch Swag Locations
Returns a list of approved locations where a given swag item is available and can be picked up, including the location ID, name, and store number. The locations returned depend on how the swag item's inventory is configured—globally or by location.
This API is available only to businesses with the "Allow members to save points for swag" feature enabled. The response includes approved locations sorted alphabetically by name, along with pagination metadata.
Prerequisite: The Save points for swag redemption feature must be enabled for the business. Contact your Punchh representative to update this Punchh platform configuration.
Which Locations Are Returned
The result is driven by the swag's inventory item configuration:
| Scenario | Availability Configuration | Result |
|---|---|---|
| Not configured | No inventory configured | Empty list |
| Global – single location | Global availability, restricted to a single location, stock available | The single approved location |
| Global – tag | Global availability, restricted to a location group, stock available | All approved locations in that group |
| Global – all | Global availability, no location restriction, stock available | All approved locations of the business |
| Global – no stock | Global availability, out of stock | Empty list |
| Location-based | Per-location availability | All approved locations with stock > 0 |
Only locations with status approved are ever returned. Disapproved locations are always excluded.
See Fetch Available User's Swag, Redeem Swag, Update User's Save Points for Swag Settings, Get User's Save Points for Swag Settings and Balance, and Get Swag Shipping Details.
Headers
- Type: stringAuthorizationrequired
Used to authorize the request with access_token. It should be supplied as
Bearer ACCESS_TOKEN_GOES_HERE. - Type: stringx
-pch -digest requiredThe signature for the API call
- Type: stringContent
- Type requiredSet this header to application/json.
- Type: stringAcceptrequired
Advertises which content types the client is able to understand
- Type: stringUser
- Agent requiredUsed to identify the software, device, and application initiating the request, providing information about the client to the server. For details, see User Agent.
- Type: stringpunchh
-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.
Body
- Type: stringclientrequired
The application/client identifier
- Type: integerswag
_id requiredID of the swag redeemable whose locations are requested
- Type: integerpage
Page number for pagination. Defaults to 1. Invalid/non-positive values fall back to the default.
- Type: integerper
_page Number of records per page. Defaults to 20. Invalid/non-positive values fall back to the default.
Responses
- application/json
- application/json
- application/json
- application/json
- application/json
curl https://SERVER_NAME_GOES_HERE.punchh.com/api2/mobile/swag_locations \
--header 'Authorization: Bearer ACCESS_TOKEN_GOES_HERE' \
--header 'x-pch-digest: {{$$.env.signature}}' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'User-Agent: AppName/AppVersion/BuildNumber (OS; Model; MANUFACTURER; MODEL; OS Version)' \
--header 'punchh-app-device-id: APP_DEVICE_ID_GOES_HERE' \
--data '{
"client": "CLIENT_KEY_GOES_HERE",
"swag_id": 11033,
"page": 1,
"per_page": 20
}'
{
"data": [
{
"id": 116,
"name": "easter 7",
"store_number": "935957"
},
{
"id": 117,
"name": "easter 8",
"store_number": "935958"
}
],
"meta": {
"current_page": 1,
"next_page": 2,
"prev_page": null,
"total_pages": 3,
"total_count": 8
}
}