App Store Server API AI Employee

Leina connects to App Store Server API to help you explain purchases and investigate subscription questions. Ask in your team chat. Leina does the work and brings back the result.

Connect App Store Server API, choose what to share, and hand off your first task.

Leina + App Store Server API Example Result

You

Check transaction [transaction ID]. Summarize this customer’s subscription history and current status for our support reply.

Leina

I reviewed the purchase history and subscription records. The latest subscription is active.

App Store · Support summary

Customer subscription

The latest renewal is reflected in the subscription record.

Purchase history
Initial purchase followed by a renewal.
Current subscription
Active in the latest reported subscription status.
Answer subscription questions with the purchase history.

What Is a App Store Server API AI Agent?

An App Store AI agent can turn a customer’s purchase history and subscription records into a support summary without changing their subscription.

You specify the source and the destination. Leina uses the content available to your connection and returns the result for you to review.

App Store Server API

The App Store Server API gives app teams access to purchase and subscription records.

  1. Identify the purchase

    Provide a transaction belonging to this customer and app.

  2. Review the history

    Read the purchase and subscription records.

  3. Prepare the reply

    Summarize the reported status for support.

What to Ask Leina to Do with App Store Server API

Copy a prompt, add your details, and send it to Leina in your connected team chat.

Explain a Customer’s Purchase History

Review purchase history and subscription status for transaction [transaction ID]. Prepare a customer support summary without changing the subscription.

app_store_server

Investigate Notification Delivery

Review App Store notifications during [time range], including failed deliveries. Summarize the delivery problems by notification type.

app_store_server

Your next App Store Server API task can start with a message.

Connect. Ask. Get the Result.

Tell Leina what you need in your team chat. Include the source, destination, and expected result.

  1. Connect Your Account

    Connect the tools involved and give Leina access to the content it needs.

  2. Try a Task

    Share the source material, say where the result belongs, and describe what you need.

  3. Check the Result

    Review the result and any changes in the connected app.

Put Leina to Work in App Store Server API

Hand off these everyday tasks to your AI employee.

Get Transaction History

List a customer's in-app purchase transactions for your app, oldest first by default, decoded from the signed payloads Apple returns. Pass sort DESCENDING to get the most recent transactions first. Returns up to 20 transactions per page.

Get Transaction Info

Read one in-app purchase transaction by identifier, decoded from the signed payload Apple returns.

Get App Transaction Info

Read the app download transaction for a customer, decoded from the signed payload Apple returns. It records when and on which platform the customer first acquired the app.

Look Up Order Id

Look up the in-app purchase transactions behind an order ID from a customer's App Store receipt, to check that the order is genuine and belongs to your app. Apple serves this endpoint only in the production environment, so it fails on a sandbox connection.

Set App Account Token

Set or replace the app account token on a transaction, to associate a purchase made outside your app with a customer on your own service. Overwrites any token already set.

Finish Transaction

Tell the App Store that your server finished delivering the content for a transaction. Call it only after the customer has the content; it cannot be undone. Apple still returns a finished transaction from get_transaction_history, so do not treat its disappearance as confirmation.

Get All Subscription Statuses

Read the status of every auto-renewable subscription a customer has for your app, grouped by subscription group, with the latest transaction and renewal information of each decoded from the signed payloads Apple returns.

Extend Subscription Renewal Date

Extend the renewal date of one customer's active auto-renewable subscription, to compensate for a service outage or a cancelled event. The extension cannot be reversed, and Apple emails the customer about the new renewal date.

Extend Renewal Date For All Active Subscribers

Extend the renewal date of every active subscription to one product, optionally limited to some storefronts. The App Store processes the request asynchronously; poll get_subscription_renewal_date_extension_status for the outcome. The extension cannot be reversed.

Get Subscription Renewal Date Extension Status

Check how far the App Store has got with a renewal date extension that was requested for all active subscribers of a product.

Get Refund History

List the in-app purchase transactions the App Store refunded for a customer in your app, newest first, decoded from the signed payloads Apple returns. Returns up to 20 transactions per page.

Send Consumption Information

Send consumption information for an in-app purchase after a CONSUMPTION_REQUEST notification, so the App Store can decide on the customer's refund request. Apple expects an answer within 12 hours of the notification. Use this for App Store in-app purchases that do not go through the Advanced Commerce API.

Send Consumption Information V1

Send the version 1 consumption information for an in-app purchase after a CONSUMPTION_REQUEST notification. Apple documents this shape for purchases made through the Advanced Commerce API; use send_consumption_information for ordinary App Store in-app purchases.

Request Test Notification

Ask the App Store to send a TEST notification to the App Store Server Notifications URL configured for your app, and get back the token that identifies the attempt. Fails when no notification URL is configured for the selected environment.

Get Test Notification Status

Read the delivery result of a test notification, with the notification payload decoded from the signed payload Apple returns. Apple answers 404 until it has finished the first delivery attempt.

Get Notification History

List the App Store Server Notifications the App Store tried to deliver to your server in a time span, with each notification payload decoded. History covers the past 180 days in production and the past 30 days in sandbox, and returns up to 20 records per page.

Upload Retention Image

Upload a PNG image for retention messages, either a FULL_SIZE image shown above the message body or a BULLET_POINT icon. The image starts in the PENDING state and Apple reviews it before it can be displayed; check the state with get_retention_image_list. Each app can hold up to 2000 images and an identifier can be uploaded only once. Only images and messages in the APPROVED state are shown to customers; the sandbox approves uploads immediately. Apple grants Retention Messaging API access per developer account; without it these endpoints answer 404 with no error body.

Get Retention Image List

List every image uploaded for retention messaging in this app and environment, with its size slot and approval state. Only images and messages in the APPROVED state are shown to customers; the sandbox approves uploads immediately. Apple grants Retention Messaging API access per developer account; without it these endpoints answer 404 with no error body.

Delete Retention Image

Delete an uploaded retention image. Apple refuses with 403 while a message still references the image, so delete the message first; a missing image answers 404. Apple grants Retention Messaging API access per developer account; without it these endpoints answer 404 with no error body.

Upload Retention Message

Upload the text of a retention message: a header, a body, optionally a full-size image and bullet points with icons. The message starts in the PENDING state and Apple reviews it; check the state with get_retention_message_list. Leave out image and bulletPoints for messages you will use as switch-plan or promotional-offer messages. Each app can hold up to 2000 messages and an identifier can be uploaded only once. Only images and messages in the APPROVED state are shown to customers; the sandbox approves uploads immediately. Apple grants Retention Messaging API access per developer account; without it these endpoints answer 404 with no error body.

Get Retention Message List

List every message uploaded for retention messaging in this app and environment, with its approval state. A message that carries an image also needs that image to be APPROVED; check it with get_retention_image_list. Apple grants Retention Messaging API access per developer account; without it these endpoints answer 404 with no error body.

Delete Retention Message

Delete an uploaded retention message. A missing message answers 404. Stop returning the identifier from your Get Retention Message endpoint first, and delete any image it used afterwards with delete_retention_image. Apple grants Retention Messaging API access per developer account; without it these endpoints answer 404 with no error body.

Configure Default Retention Message

Set the default retention message the App Store shows for one subscription product in one locale, replacing any default configured before. Only text-based messages, with or without an image, can be defaults, and both the message and its image must be APPROVED. Products without a default in a locale show no retention message there, and the default is also the fallback when your real-time endpoint fails. Apple grants Retention Messaging API access per developer account; without it these endpoints answer 404 with no error body.

Get Default Retention Message

Read which message is configured as the default retention message for one subscription product in one locale. Returns a null messageIdentifier when no default is configured there. Apple grants Retention Messaging API access per developer account; without it these endpoints answer 404 with no error body.

Delete Default Retention Message

Remove the default retention message of one subscription product in one locale, so the App Store shows no retention message there. Succeeds even when no default was configured. Apple grants Retention Messaging API access per developer account; without it these endpoints answer 404 with no error body.

Configure Retention Realtime Url

Register the URL of your Get Retention Message endpoint for the environment of this connection, replacing any URL registered before. Once set, the App Store calls it whenever a subscriber opens the cancellation flow and shows the message you pick. A production URL is accepted only after your endpoint passed the sandbox performance test (Apple answers 403 otherwise). Apple grants Retention Messaging API access per developer account; without it these endpoints answer 404 with no error body.

Get Retention Realtime Url

Read the URL of the Get Retention Message endpoint registered for the environment of this connection. Returns a null realtimeUrl when none is registered. Apple grants Retention Messaging API access per developer account; without it these endpoints answer 404 with no error body.

Delete Retention Realtime Url

Unregister the Get Retention Message endpoint URL for the environment of this connection. Afterwards the App Store shows only default messages in that environment until a URL is registered again. Apple grants Retention Messaging API access per developer account; without it these endpoints answer 404 with no error body.

Initiate Retention Performance Test

Start Apple's performance test of the Get Retention Message endpoint registered in the sandbox, using an active sandbox subscription as the sample purchase. Passing the test is required before configure_retention_realtime_url accepts a production URL. Returns the request identifier and the test parameters; the test runs for the returned totalDuration. Available only on a connection whose environment is sandbox; Apple serves the performance test endpoints on the sandbox host alone. Apple grants Retention Messaging API access per developer account; without it these endpoints answer 404 with no error body.

Get Retention Performance Test Results

Read the outcome of a sandbox performance test started with initiate_retention_performance_test: PENDING while it runs, then PASS or FAIL together with the measured response times, success rate and failure counts. Available only on a connection whose environment is sandbox; Apple serves the performance test endpoints on the sandbox host alone. Apple grants Retention Messaging API access per developer account; without it these endpoints answer 404 with no error body.

More Tools for Your AI Employee

Connect the Apps your work depends on, and give Leina the context to carry the task forward.

Keep the Conversation Moving. Let Leina Pick Up the Work.

Hand off a task while your team is discussing it. Leina uses your connected tools and brings the result back to the conversation.

See How Leina Works in Slack
LeinaExample Result

I reviewed the purchase history and subscription records. The latest subscription is active.

Customer subscription

App Store Server API + Leina: Your Questions, Answered

Can I use test purchases with the production connection?

Use the matching environment. Sandbox and TestFlight purchases belong to the sandbox; production purchases use production.

Will a support review change the subscription?

No. Reading purchase history and status does not modify renewal dates or customer entitlements.

Make Leina Your App Store Server API AI Employee

Start with one task you already need to do. Tell Leina what a finished result should look like.

Connect App Store Server API, choose what to share, and hand off your first task.