All Collections
Develop
Software Developer Kits
How to use the PassKit Java SDK
How to use the PassKit Java SDK

Guide to PassKit Java SDK setup with templates for memberships, coupons, flights, and event tickets.

Claudia avatar
Written by Claudia
Updated over a week ago

Prerequisites

You will need the following:

Getting started

  1. Download or clone this quickstart repository, create a folder credentials in the resources folder of the repository and add the following three PassKit SDK credential files :

    • certificate.pem

    • ca-chain.pem

    • key-java.pem

    You can disregard the key.pem credentials file as it is not compatible with Java.

  2. Edit passkit.properties in the resources folder

    • set credentials.password to the password that you set when requesting your SDK credentials from PassKit

    • if you are using flights edit credentials.appleCertificate with your id

    • set other options as required

      ScreenShot
  3. If you wish to receive enrollment emails for loyalty or coupon cards edit baseEmail and vipEmail on lines 77 and 78 in QuickstartLoyalty for loyalty, and lines 70 and 71 in QuickstartCoupons for coupons.

  4. If you are using flights edit appleCertificate on line 59 in QuickstartFlights

Once you have set up the certificates and any other variables from the above steps you can then pick one of the pre-made templates to start getting up and running with the PassKit SDK.

Membership/Loyalty Templates

These templates can be found in the QuickstartLoyalty file in 'src/main/java/com/passkit/quickstart' and contain the basic fields for each of the actions, additional fields or templates can be made based on the calls found here.

  • Create image assets for the pass

  • Create default pass templates for tiers

  • Create a new tier

  • Create a loyalty program with a previously made tier

  • Enrol a member in each tier

  • Check-in a member

  • Check-out a member

  • Add loyalty points to a member

  • Delete all membership assests

Coupons Templates

These templates can be found in the QuickstartCoupons file in 'src/main/java/com/passkit/quickstart' and contain the basic fields for each of the actions, additional fields or templates can be made based on the calls found here.

  • Create image assets for coupons

  • Create a campaign

  • Modify a campaign

  • Create an offer

  • Enrol customer on offer

  • Redeem a coupon

  • Delete an offer

Flights Templates

These templates can be found in the QuickstartFlightTickets file in 'src/main/java/com/passkit/quickstart' and contain the basic fields for each of the actions, additional fields or templates can be made based on the calls found here.

  • Create image assets for flight tickets

  • Create default template for a regular flight ticket

  • Create a flight

  • Create an airport

  • Issue a basic ticket (auto create an event)

  • Delete all ticket assets

Event Tickets Templates

These templates can be found in the QuickstartEventTickets file in 'src/main/java/com/passkit/quickstart' and contain the basic fields for each of the actions, additional fields or templates can be made based on the calls found here.

  • Create image assets

  • Create default template for an event ticket

  • Create a venue

  • Create a production

  • Create ticket type

  • Issue a ticket

  • Validate ticket

  • Redeem ticket

  • Delete all ticket assets

For implementing in your own projects, use the GrpcConnection class to manage connection to the PassKit gRPC endpoints.

Use the GrpcConnection's ManagedChannel object to create the stubs you require in your implementation.

Testing Templates

  • Membership/Loyalty: Run gradle test --tests QuickstartLoyaltyTest.

  • Event Tickets: Run gradle test --tests QuickstartEventTicketsTest.

  • Coupons: Run gradle test --tests QuickstartCouponsTest.

  • Flight Tickets: Run gradle test --tests QuickstartFlightTicketsTest.

Note: If you don't plan to use certain templates, consider deleting them from the quickstart files to avoid unintended actions.

This comprehensive guide will help you set up the PassKit Java SDK, configure credentials, and explore a variety of pre-made templates to streamline your PassKit integration.

Did this answer your question?