appstoreserverlibrary.jws_signature_creator module

class appstoreserverlibrary.jws_signature_creator.AdvancedCommerceAPIInAppRequest[source]

Bases: object

class appstoreserverlibrary.jws_signature_creator.AdvancedCommerceAPIInAppSignatureCreator(signing_key: bytes, key_id: str, issuer_id: str, bundle_id: str)[source]

Bases: JWSSignatureCreator

create_signature(advanced_commerce_in_app_request: AdvancedCommerceAPIInAppRequest) str[source]

Create an Advanced Commerce in-app signed request. https://developer.apple.com/documentation/storekit/generating-jws-to-sign-app-store-requests

Parameters:

advanced_commerce_in_app_request – The request to be signed.

Returns:

The signed JWS.

class appstoreserverlibrary.jws_signature_creator.IntroductoryOfferEligibilitySignatureCreator(signing_key: bytes, key_id: str, issuer_id: str, bundle_id: str)[source]

Bases: JWSSignatureCreator

create_signature(product_id: str, allow_introductory_offer: bool, transaction_id: str) str[source]

Create an introductory offer eligibility signature. https://developer.apple.com/documentation/storekit/generating-jws-to-sign-app-store-requests

Parameters:
  • product_id – The unique identifier of the product

  • allow_introductory_offer – A boolean value that determines whether the customer is eligible for an introductory offer

  • transaction_id – The unique identifier of any transaction that belongs to the customer. You can use the customer’s appTransactionId, even for customers who haven’t made any In-App Purchases in your app.

Returns:

The signed JWS.

class appstoreserverlibrary.jws_signature_creator.JWSSignatureCreator(audience: str, signing_key: bytes, key_id: str, issuer_id: str, bundle_id: str)[source]

Bases: object

class appstoreserverlibrary.jws_signature_creator.PromotionalOfferV2SignatureCreator(signing_key: bytes, key_id: str, issuer_id: str, bundle_id: str)[source]

Bases: JWSSignatureCreator

create_signature(product_id: str, offer_identifier: str, transaction_id: str | None) str[source]

Create a promotional offer V2 signature. https://developer.apple.com/documentation/storekit/generating-jws-to-sign-app-store-requests

Parameters:
  • product_id – The unique identifier of the product

  • offer_identifier – The promotional offer identifier that you set up in App Store Connect

  • transaction_id – The unique identifier of any transaction that belongs to the customer. You can use the customer’s appTransactionId, even for customers who haven’t made any In-App Purchases in your app. This field is optional, but recommended.

Returns:

The signed JWS.