@apple/app-store-server-library
    Preparing search index...

    Class AppStoreServerAPIClient

    Index

    Constructors

    • Create an App Store Server API client

      Parameters

      • signingKey: string

        Your private key downloaded from App Store Connect

      • keyId: string

        Your private key ID from App Store Connect

      • issuerId: string

        Your issuer ID from the Keys page in App Store Connect

      • bundleId: string

        Your app’s bundle ID

      • environment: Environment

        The environment to target

      Returns AppStoreServerAPIClient

    Methods

    • Configure a default message for a specific product in a specific locale.

      Parameters

      • productId: string

        The product identifier for the default configuration.

      • locale: string

        The locale for the default configuration.

      • defaultConfigurationRequest: DefaultConfigurationRequest

        The request body that includes the message identifier to configure as the default message.

      Returns Promise<void>

      APIException If a response was returned indicating the request could not be processed Configure Default Message

    • Delete a default message for a product in a locale.

      Parameters

      • productId: string

        The product ID of the default message configuration.

      • locale: string

        The locale of the default message configuration.

      Returns Promise<void>

      APIException If a response was returned indicating the request could not be processed Delete Default Message

    • Delete a previously uploaded image.

      Parameters

      • imageIdentifier: string

        The identifier of the image to delete.

      Returns Promise<void>

      APIException If a response was returned indicating the request could not be processed Delete Image

    • Delete a previously uploaded message.

      Parameters

      • messageIdentifier: string

        The identifier of the message to delete.

      Returns Promise<void>

      APIException If a response was returned indicating the request could not be processed Delete Message

    • Extends the renewal date of a customer’s active subscription using the original transaction identifier.

      Parameters

      • originalTransactionId: string

        The original transaction identifier of the subscription receiving a renewal date extension.

      • extendRenewalDateRequest: ExtendRenewalDateRequest

        The request body containing subscription-renewal-extension data.

      Returns Promise<ExtendRenewalDateResponse>

      A response that indicates whether an individual renewal-date extension succeeded, and related details.

      APIException If a response was returned indicating the request could not be processed Extend a Subscription Renewal Date

    • Get the statuses for all of a customer’s auto-renewable subscriptions in your app.

      Parameters

      • transactionId: string

        The identifier of a transaction that belongs to the customer, and which may be an original transaction identifier.

      • status: Status[] | undefined = undefined

        An optional filter that indicates the status of subscriptions to include in the response. Your query may specify more than one status query parameter.

      Returns Promise<StatusResponse>

      A response that contains status information for all of a customer’s auto-renewable subscriptions in your app.

      APIException If a response was returned indicating the request could not be processed Get All Subscription Statuses

    • Get a customer's app transaction information for your app.

      Parameters

      • transactionId: string

        Any originalTransactionId, transactionId or appTransactionId that belongs to the customer for your app.

      Returns Promise<AppTransactionInfoResponse>

      A response that contains signed app transaction information for a customer.

      APIException If a response was returned indicating the request could not be processed Get App Transaction Info

    • Get the image identifier and state for all uploaded images.

      Returns Promise<GetImageListResponse>

      A response that contains status information for all images.

      APIException If a response was returned indicating the request could not be processed Get Image List

    • Get a list of notifications that the App Store server attempted to send to your server.

      Parameters

      • paginationToken: string | null

        An optional token you use to get the next set of up to 20 notification history records. All responses that have more records available include a paginationToken. Omit this parameter the first time you call this endpoint.

      • notificationHistoryRequest: NotificationHistoryRequest

        The request body that includes the start and end dates, and optional query constraints.

      Returns Promise<NotificationHistoryResponse>

      A response that contains the App Store Server Notifications history for your app.

      APIException If a response was returned indicating the request could not be processed Get Notification History

    • Get a paginated list of all of a customer’s refunded in-app purchases for your app.

      Parameters

      • transactionId: string

        The identifier of a transaction that belongs to the customer, and which may be an original transaction identifier.

      • revision: string | null

        A token you provide to get the next set of up to 20 transactions. All responses include a revision token. Use the revision token from the previous RefundHistoryResponse.

      Returns Promise<RefundHistoryResponse>

      A response that contains status information for all of a customer’s auto-renewable subscriptions in your app.

      APIException If a response was returned indicating the request could not be processed Get Refund History

    • Checks whether a renewal date extension request completed, and provides the final count of successful or failed extensions.

      Parameters

      • requestIdentifier: string

        The UUID that represents your request to the Extend Subscription Renewal Dates for All Active Subscribers endpoint.

      • productId: string

        The product identifier of the auto-renewable subscription that you request a renewal-date extension for.

      Returns Promise<MassExtendRenewalDateStatusResponse>

      A response that indicates the current status of a request to extend the subscription renewal date to all eligible subscribers.

      APIException If a response was returned indicating the request could not be processed Get Status of Subscription Renewal Date Extensions

    • Check the status of the test App Store server notification sent to your server.

      Parameters

      • testNotificationToken: string

        The test notification token received from the Request a Test Notification endpoint

      Returns Promise<CheckTestNotificationResponse>

      A response that contains the contents of the test notification sent by the App Store server and the result from your server.

      APIException If a response was returned indicating the request could not be processed Get Test Notification Status

    • Get a customer’s in-app purchase transaction history for your app.

      Parameters

      • transactionId: string

        The identifier of a transaction that belongs to the customer, and which may be an original transaction identifier.

      • revision: string | null

        A token you provide to get the next set of up to 20 transactions. All responses include a revision token. Note: For requests that use the revision token, include the same query parameters from the initial request. Use the revision token from the previous HistoryResponse.

      • transactionHistoryRequest: TransactionHistoryRequest
      • version: GetTransactionHistoryVersion = GetTransactionHistoryVersion.V1

        The version of the Get Transaction History endpoint to use. V2 is recommended.

      Returns Promise<HistoryResponse>

      A response that contains the customer’s transaction history for an app.

      APIException If a response was returned indicating the request could not be processed Get Transaction History

    • Get information about a single transaction for your app.

      Parameters

      • transactionId: string

        The identifier of a transaction that belongs to the customer, and which may be an original transaction identifier.

      Returns Promise<TransactionInfoResponse>

      A response that contains signed transaction information for a single transaction.

      APIException If a response was returned indicating the request could not be processed Get Transaction Info

    • Get a customer’s in-app purchases from a receipt using the order ID.

      Parameters

      • orderId: string

        The order ID for in-app purchases that belong to the customer.

      Returns Promise<OrderLookupResponse>

      A response that includes the order lookup status and an array of signed transactions for the in-app purchases in the order.

      APIException If a response was returned indicating the request could not be processed Look Up Order ID

    • Parameters

      • path: string
      • parsedQueryParameters: URLSearchParams
      • method: string
      • requestBody: string | Buffer<ArrayBufferLike> | undefined
      • headers: { [key: string]: string }

      Returns Promise<Response>

    • Type Parameters

      • T

      Parameters

      • path: string
      • method: string
      • queryParameters: { [key: string]: string[] }
      • body: object | Buffer<ArrayBufferLike> | null
      • validator: Validator<T> | null
      • OptionalcontentType: string

      Returns Promise<T>

    • Send consumption information about a consumable in-app purchase to the App Store after your server receives a consumption request notification.

      Parameters

      • transactionId: string

        The transaction identifier for which you’re providing consumption information. You receive this identifier in the CONSUMPTION_REQUEST notification the App Store sends to your server.

      • consumptionRequest: ConsumptionRequest

        The request body containing consumption information.

      Returns Promise<void>

      APIException If a response was returned indicating the request could not be processed Send Consumption Information

    • Sets the app account token value for a purchase the customer makes outside your app, or updates its value in an existing transaction.

      Parameters

      • originalTransactionId: string

        The original transaction identifier of the transaction to receive the app account token update.

      • updateAppAccountTokenRequest: UpdateAppAccountTokenRequest

        The request body that contains a valid app account token value.

      Returns Promise<void>

      APIException If a response was returned indicating the request could not be processed. Set App Account Token

    • Upload an image to use for retention messaging.

      Parameters

      • imageIdentifier: string

        A UUID you provide to uniquely identify the image you upload. Must be lowercase.

      • image: Buffer

        The image file to upload.

      Returns Promise<void>

      APIException If a response was returned indicating the request could not be processed Upload Image

    • Upload a message to use for retention messaging.

      Parameters

      • messageIdentifier: string

        A UUID you provide to uniquely identify the message you upload. Must be lowercase.

      • uploadMessageRequestBody: UploadMessageRequestBody

        The message text to upload.

      Returns Promise<void>

      APIException If a response was returned indicating the request could not be processed Upload Message