Apple Offer Signature app icon

Promotional Offer

Apple Offer Signature Generator

Home
Blog
Tools
Github
Medium
Stack
Contact Me

Apple Promotional Offer Signature

TESTING TOOL

Apple Promotional Offer Signature Generator

This tool allows you to generate a promotional offer signature for testing. A signature is required for a promotional offers during the purchase of In App subscription via StoreKit..

Apple Offer Signature hero image

Apple Promotional Offer Signature

Generate Apple promotional offer signatures for testing purposes during development.

Learn more about the field requirements here
E.g: com.app.ios
E.g: 2X9R4HAB12
E.g: com.app.subscription.gold
E.g: com.app.subscription.gold.fiftyOff
User defined optional string. May be empty.

For StoreKit1, make sure to set the same username or account token before adding to payment queue otherwise use will receive SKErrorDomain error 12

let payment = SKMutablePayment(product: product)
payment.applicationUsername = "xyz"

For StoreKit2 Application username or Account token is no longer required but make sure to set it empty string while generating the signature. Otherwise you will receiveAMSServerErrorCode=3903

Unique nonce (lower cased UUID) for each signature
Unix time stamp in milliseconds. Within 24 hrs
The private key in .p8 format

NB: This tool works within a browser locally and does not sync keys. You can always revoke your keys from App Store Connect. Server side is required to get the additional parameters mainly because adding your private key inside your app's bundle isn't a good idea.

Usage

How to use

This tool is utilising the logic from the sample project provided by Apple Here. For purchasing promotional offers developer needs some additional parameters to pass in before adding it in the payment queue. See example below.

StoreKit 1

swift

let discount = SKPaymentDiscount(identifier: offerIdentifier,
keyIdentifier: keyIDentifier,
nonce: UUID(uuidString: nonce),
signature: signature,
timestamp: NSNumber(value: timeStamp))
payment.paymentDiscount = discount
SKPaymentQueue.default().add(payment)

StoreKit 2

swift

private func getOfferDetails(offerId: String,
productId: String) async throws -> Product.PurchaseOption {
try await withCheckedThrowingContinuation { continuation in
IMPPackagesAPI.getOfferDetails(offerID: offerId,
productId: productId) { result in
switch result {
case .success(let response):
guard let offerData = response.data,
let nonce = UUID(uuidString: offerData.nonce),
let signature = Data(base64Encoded: offerData.signature) else {
continuation.resume(throwing: NSError(domain: "OfferDataMissing", code: -1))
return false
}
let offerId = offerData.offerIdentifier
let keyId = offerData.keyIDentifier
let timestamp = Int(offerData.timeStamp)
let offer = Product.PurchaseOption.promotionalOffer(offerID: offerId,
keyID: keyId,
nonce: nonce,
signature: signature,
timestamp: timestamp)
continuation.resume(returning: offer)
return true
case .failure(let error):
continuation.resume(throwing: error)
return false
}
}
}
}

Here is how you purchase the product with the offer

swift

var options: [Product.PurchaseOption] = []
if let offerId {
let offer = try? await getOfferDetails(offerId: offerId, productId: productId)
if let offer {
options.append(offer)
}
}
let result = try await product.purchase(options: Set(options))

Learn More

More Information

See Apple promotional offer signature generator in action and learn how it works.

Apple Promotional Offer Signature Generator

Thu Mar 12 2026 ‒ 3 mins read

Apple Promotional Offer Signature Generator

An Apple Promotional Offer Signature Generator helps developers quickly generate the required cryptographic signature for Apple App Store promotional offers.

Apps
MZ

Muhammad Zeeshan