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

  • 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: undefined | Status[] = 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 list of notifications that the App Store server attempted to send to your server.

    Parameters

    • paginationToken: null | string

      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: null | string

      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: null | string

      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
    • stringBody: undefined | string
    • headers: {
          [key: string]: string;
      }
      • [key: string]: string

    Returns Promise<Response>

  • Type Parameters

    • T

    Parameters

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

    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