Pular para o conteúdo

Apple Wallet PassKit API

Este conteúdo ainda não está disponível no seu idioma.

The PassKit Designer API lets you create, update, download, and manage Apple Wallet passes programmatically. It supports the same operations the pass builder in the Control Panel performs. Use it to issue loyalty cards, coupons, event tickets, boarding passes, and store cards, and to push live updates to passes already installed on your users’ devices.

https://apple-passkit.svc-nue.pushwoosh.com

All endpoints are served over HTTPS. Requests and responses use application/json unless noted otherwise.

Authentication

Anchor link to

Every request must include an Authorization header with your Pushwoosh API access token:

Authorization: Token <api-token>

The account that owns the token must own the application referenced by applicationCode. A request for an application that belongs to another account returns 403 Forbidden.

Conventions

Anchor link to
  • Field naming: JSON fields use lowerCamelCase (for example, passTypeIdentifier, serialNumber, backgroundColor).
  • Unpopulated fields: responses include all fields, even when empty or zero-valued.
  • Binary data: bytes fields such as pkpassData and image data are Base64-encoded strings in JSON.
  • Serial numbers: the serialNumber is always assigned by the server when a pass is created. Any value you send on create is ignored; it identifies the pass for all later operations.

Error responses

Anchor link to

The API maps internal status codes to HTTP status codes:

HTTP statusMeaning
400 Bad RequestInvalid argument—a required field is missing or malformed.
401 UnauthorizedMissing or invalid Authorization header.
403 ForbiddenThe application does not belong to the caller’s account.
404 Not FoundThe pass, template, or application was not found.
503 Service UnavailableThe service is at capacity or temporarily unavailable.
MethodPathDescription
POST/api/pass/validateValidate a pass configuration
POST/api/pass/createCreate a new .pkpass
POST/api/pass/update/{serialNumber}Update an existing pass and notify devices
GET/api/passesList all passes for an application
GET/api/pass/{applicationCode}/{serialNumber}Get a single pass
GET/api/pass/{applicationCode}/{serialNumber}/downloadDownload the .pkpass of an existing pass
DELETE/api/pass/{applicationCode}/{serialNumber}Delete a pass
GET/api/pass/{serialNumber}/registrationsList devices registered for a pass
GET/api/configGet the application’s PassKit configuration
GET/api/templatesList available pass templates
GET/api/templates/{filename}Get a single template

Create a pass

Anchor link to

Generates, signs, and stores a new pass, then returns its server-assigned serial number.

POST /api/pass/create

Request body

Anchor link to
ParameterTypeRequiredDescription
passobjectYesThe pass object describing the pass.
imagesarray of objectsNoPass images (icon, logo, etc.). icon and logo are required for a valid pass.
userIdstringYesThe Pushwoosh User ID the pass is issued to.
applicationCodestringYesThe Pushwoosh application code.
Request example
Anchor link to
{
"applicationCode": "XXXXX-XXXXX",
"userId": "user-123",
"pass": {
"description": "Acme loyalty card",
"logoText": "Acme",
"backgroundColor": "rgb(60, 65, 76)",
"foregroundColor": "rgb(255, 255, 255)",
"labelColor": "rgb(255, 255, 255)",
"storeCard": {
"primaryFields": [
{ "key": "balance", "label": "BALANCE", "value": "1200 pts" }
],
"secondaryFields": [
{ "key": "member", "label": "MEMBER", "value": "Jane Doe" }
]
},
"barcodes": [
{
"format": "PKBarcodeFormatQR",
"message": "1234567890",
"messageEncoding": "iso-8859-1"
}
]
},
"images": [
{ "imageType": "icon", "data": "<base64>", "contentType": "image/png" },
{ "imageType": "logo", "data": "<base64>", "contentType": "image/png" }
]
}
FieldTypeDescription
serialNumberstringServer-assigned unique identity of the created pass. Use it to fetch the pass (Get a pass) or download the .pkpass (Download a pass).
messagestringResult message.

Response example

Anchor link to
{
"serialNumber": "a1b2c3d4-1234-5678-9abc-def012345678",
"message": "Pass created successfully"
}

Validate a pass

Anchor link to

Checks a pass configuration against Apple’s specifications without creating a file. Useful before calling create.

POST /api/pass/validate

Request body

Anchor link to
ParameterTypeRequiredDescription
passobjectYesThe pass object to validate.
FieldTypeDescription
validbooleanWhether the pass passes validation.
errorsarray of stringsBlocking problems that must be fixed.
warningsarray of stringsNon-blocking advisories.

Update a pass

Anchor link to

Regenerates the pass with new content, re-signs it, increments its update tag, and sends a silent push notification to every device that registered the pass. iOS then fetches and installs the updated version in the background.

POST /api/pass/update/{serialNumber}

Path parameters

Anchor link to
ParameterTypeDescription
serialNumberstringThe serial number returned when the pass was created.

Request body

Anchor link to
ParameterTypeRequiredDescription
updatesobjectYesThe full pass object with the new content.
applicationCodestringYesThe Pushwoosh application code.

The serialNumber (from the path) and the pass’s authentication token are preserved by the server regardless of what you send.

FieldTypeDescription
successbooleanWhether the update succeeded.
updateTagintegerNew update tag (a Unix timestamp).
messagestringResult message.

List passes

Anchor link to

Returns a paginated, sorted list of the passes stored for an application.

GET /api/passes?applicationCode=XXXXX-XXXXX&page=0&perPage=20

Query parameters

Anchor link to
ParameterTypeRequiredDescription
applicationCodestringYesThe Pushwoosh application code.
orderBystringNoSort field: UPDATED (default) or CREATED.
orderDirectionstringNoSort direction: DESC (default, newest first) or ASC.
pageintegerNoZero-based page index. Defaults to 0.
perPageintegerNoPage size. 0 or omitted uses the server default.
FieldTypeDescription
passesarray of objectsThe current page of pass records.
pageintegerThe returned page index.
perPageintegerThe page size used for this response.
totalintegerTotal number of passes for the application across all pages.
Response example
Anchor link to
{
"passes": [ /* pass records */ ],
"page": 0,
"perPage": 20,
"total": 137
}

Get a pass

Anchor link to

Returns a single stored pass, including its full pass object.

GET /api/pass/{applicationCode}/{serialNumber}

Path parameters

Anchor link to
ParameterTypeDescription
applicationCodestringThe Pushwoosh application code.
serialNumberstringThe pass serial number.

Returns { "pass": { ... } }, a single pass record.

Download a pass

Anchor link to

Returns the stored .pkpass file of an existing pass.

GET /api/pass/{applicationCode}/{serialNumber}/download

FieldTypeDescription
pkpassDatastring (Base64)The .pkpass file.
filenamestringSuggested file name.

Delete a pass

Anchor link to

Removes a pass record and its stored .pkpass file.

DELETE /api/pass/{applicationCode}/{serialNumber}

FieldTypeDescription
successbooleanWhether the pass was deleted.
messagestringResult message.

Get pass registrations

Anchor link to

Lists the devices that have added the pass and are registered for updates.

GET /api/pass/{serialNumber}/registrations?applicationCode=XXXXX-XXXXX

Returns { "registrations": [ ... ] }, where each item has:

FieldTypeDescription
deviceLibraryIdentifierstringApple device library identifier.
pushTokenstringThe pass push token for the device.

Get configuration

Anchor link to

Returns the PassKit configuration resolved for an application from its certificate.

GET /api/config?applicationCode=XXXXX-XXXXX

FieldTypeDescription
teamIdentifierstringApple Team ID from the certificate.
passTypeIdentifierstringPass Type ID from the certificate.
organizationNamestringOrganization name from the certificate.
hasCertificatebooleanWhether a certificate is configured.
webServiceUrlstringBase URL of the pass web service. Clients build an install link by appending /v1/passes/{passType}/{serial}?token={authToken}.

List the available pass templates, or fetch one as a pass object you can use as a starting point.

GET /api/templates — returns { "templates": [ { "filename", "name", "description", "style" } ] }.

GET /api/templates/{filename} — returns { "template": { ...pass object... } }.

Share a pass as a QR code

Anchor link to

To let users add a pass by scanning a QR code (or tapping a link), encode the pass install URL into a QR code. The URL is built from values you already get back from the API:

{webServiceUrl}/v1/passes/{passTypeIdentifier}/{serialNumber}?token={authenticationToken}
URL partWhere to get it
webServiceUrlGET /api/configwebServiceUrl
passTypeIdentifierpass recordpass.passTypeIdentifier (from list/get)
serialNumberpass recordserialNumber
authenticationTokenpass recordpass.authenticationToken

Example:

https://apple-passkit.svc-nue.pushwoosh.com/v1/passes/pass.com.acme.loyalty/a1b2c3d4-1234-5678-9abc-def012345678?token=AbC123XyZ

Render this URL as a QR code with any QR library. When a user scans it, their device opens the link, downloads the latest .pkpass, and Wallet prompts them to add it—which also registers the device for updates.

Object reference

Anchor link to

Pass object

Anchor link to
FieldTypeDescription
formatVersionintegerPass format version. Defaults to 1.
passTypeIdentifierstringApple Pass Type ID (pass.com.yourcompany.passtype). Defaults from the certificate.
serialNumberstringAssigned by the server on create; identifies the pass.
teamIdentifierstringApple Team ID. Defaults from the certificate.
organizationNamestringOrganization shown on the pass. Defaults from the certificate.
descriptionstringHuman-readable description (required by Apple).
boardingPass / coupon / eventTicket / storeCard / genericobjectThe pass style. Exactly one must be set. See field groups.
backgroundColorstringBackground color, rgb(r, g, b).
foregroundColorstringForeground (text) color, rgb(r, g, b).
labelColorstringField label color, rgb(r, g, b).
logoTextstringText shown next to the logo.
suppressStripShinebooleanDisable the shine effect on the strip image.
barcodesarrayBarcodes shown on the pass.
locationsarrayLocations that make the pass relevant.
beaconsarrayBeacons that make the pass relevant.
relevantDatestringISO 8601 date when the pass becomes relevant.
maxDistanceintegerMax distance (meters) for location relevance.
expirationDatestringISO 8601 expiration date.
voidedbooleanMarks the pass as void.
groupingIdentifierstringGroups related passes (event tickets/boarding passes).
userInfoobject (map)Arbitrary key/value app data.

Field group object

Anchor link to

Each pass style (boardingPass, coupon, eventTicket, storeCard, generic) groups fields into areas:

FieldTypeDescription
headerFieldsarrayShown in the pass header (visible when stacked in Wallet).
primaryFieldsarrayMost prominent fields.
secondaryFieldsarrayBelow the primary fields.
auxiliaryFieldsarrayAdditional fields below secondary.
backFieldsarrayShown on the back of the pass.

boardingPass additionally has transitType (PKTransitTypeAir, PKTransitTypeTrain, PKTransitTypeBus, PKTransitTypeBoat, or PKTransitTypeGeneric).

Field object

Anchor link to
FieldTypeDescription
keystringUnique field key within the pass.
labelstringField label.
valuestringField value (text or number as string).
changeMessagestringMessage shown when the value changes (use %@ as the placeholder).
textAlignmentstringPKTextAlignment value.
dateStyle / timeStylestringPKDateStyle for date/time formatting.
isRelativebooleanShow the date relative to now.
numberStylestringPKNumberStyle for number formatting.
currencyCodestringISO 4217 currency code.
dataDetectorTypesarray of stringsData detectors to apply to the value.

Barcode object

Anchor link to
FieldTypeDescription
formatstringPKBarcodeFormatQR, PKBarcodeFormatPDF417, PKBarcodeFormatAztec, or PKBarcodeFormatCode128.
messagestringData encoded in the barcode.
messageEncodingstringText encoding, typically iso-8859-1.
altTextstringText shown below the barcode.

Location object

Anchor link to
FieldTypeDescription
latitudenumberLatitude.
longitudenumberLongitude.
altitudenumberAltitude in meters.
relevantTextstringText shown on the lock screen near this location.

Beacon object

Anchor link to
FieldTypeDescription
proximityUuidstringiBeacon proximity UUID.
majorintegerMajor value.
minorintegerMinor value.
relevantTextstringText shown on the lock screen near this beacon.

Pass image object

Anchor link to
FieldTypeDescription
imageTypestringOne of icon, logo, strip, background, footer, thumbnail. icon and logo are required.
datastring (Base64)Image bytes.
contentTypestringMIME type, for example image/png.

Pass record object

Anchor link to

Returned by list/get endpoints.

FieldTypeDescription
serialNumberstringPass serial number.
passTypeIdentifierstringPass Type ID.
organizationNamestringOrganization name.
descriptionstringPass description.
createdAtstringCreation timestamp (RFC 3339).
updatedAtstringLast update timestamp (RFC 3339).
updateTagintegerCurrent update tag.
passobjectThe full pass object, for editing.
userIdstringPushwoosh User ID the pass was issued to.