Apple Wallet coupon and discount integration in mobile app

TRUETECH is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
Apple Wallet coupon and discount integration in mobile app
Medium
from 1 business day to 3 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    757
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1054
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    874
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

Apple Wallet Integration for Coupons and Discounts in Mobile Apps

A coupon in Apple Wallet is a coupon-type .pkpass. Structurally similar to storeCard, but the coupon type provides a special visual style: perforated bottom edge of the card. This is what makes a coupon visually appear as a coupon rather than just a regular card.

Coupon Structure

{
  "formatVersion": 1,
  "passTypeIdentifier": "pass.com.yourshop.coupon",
  "serialNumber": "COUPON-SUMMER2024-USER789",
  "teamIdentifier": "ABCDE12345",
  "organizationName": "YourShop",
  "description": "20% discount on summer collection",
  "foregroundColor": "rgb(255,255,255)",
  "backgroundColor": "rgb(200,50,50)",
  "coupon": {
    "primaryFields": [
      { "key": "offer", "value": "−20%", "label": "Discount" }
    ],
    "secondaryFields": [
      {
        "key": "expires",
        "value": "2024-08-31T23:59+03:00",
        "label": "Valid Until",
        "dateStyle": "PKDateStyleShort",
        "timeStyle": "PKDateStyleNone"
      }
    ],
    "auxiliaryFields": [
      { "key": "conditions", "value": "Minimum purchase 3,000 rubles", "label": "Terms" }
    ],
    "barcode": {
      "message": "COUPON-SUMMER2024-USER789",
      "format": "PKBarcodeFormatCode128",
      "messageEncoding": "iso-8859-1"
    }
  },
  "expirationDate": "2024-08-31T23:59+03:00",
  "voided": false
}

The voided: true field — Wallet visually "strikes through" the coupon and moves it to the archive. Set via push-update after redemption.

Coupon Redemption

Redemption logic is entirely server-side. The QR/barcode contains serialNumber or a unique token. The cashier scans the code, and the server:

  1. Checks serialNumber in the database
  2. Confirms the coupon hasn't expired and hasn't been redeemed
  3. Applies the discount
  4. Sets flag used = true
  5. Sends APN push → device downloads updated .pkpass with voided: true

There may be a 10–30 second delay between step 4 and 5 — this is normal. The key point is that validation happens on the server, not on the device.

Personalization and Bulk Distribution

Each coupon is a unique .pkpass for a specific user. The server generator receives userId, creates an archive on-the-fly, signs it, and provides a download link. The link can be embedded in email or a push notification.

Link format: https://api.yourshop.com/wallet/coupons/{token}.pkpass

When opened on iOS Safari, it will automatically offer "Add to Wallet" if the MIME type is application/vnd.apple.pkpass.

Geotargeting

A coupon can be tied to retail locations:

"locations": [
  { "latitude": 55.7512, "longitude": 37.6184, "relevantText": "Store on Tverskaya" },
  { "latitude": 59.9386, "longitude": 30.3141, "relevantText": "Store on Nevsky" }
]

Wallet will display a notification with relevantText on the lock screen when a user is near any location (~100 meter radius). Maximum 10 locations per pass.

Batch Distribution: Multiple Coupons in One Request

When distributing coupons to all users in a segment — the generator must work in the background. Synchronous generation of 10,000 .pkpass files will block the API server.

The right approach: job queue. Request POST /campaigns/{id}/distribute queues a task (Sidekiq, Celery, BullMQ), workers generate passes in batches and store links in the database. Users receive a push with "Add to Wallet" button — not immediately, but as generation progresses.

Each generation must use a new serialNumber and new authenticationToken in pass.json. Never distribute identical passes to different users — update systems will conflict.

Timeline

1–3 days: server-side coupon generation, redemption API, push-based invalidation via voided. Pricing is calculated individually.