AppStoreConnect API - How to set pricing

I am trying to use the AppStoreConnect API to set the price of an app. In the documentation (here) it suggests that it is possible to set the price using the API.

"To set a price for your app using App Store Connect API, create a relationship between the apps resource and appPrices"

However it links to the instructions on how to set a price using the AppStoreConnect web site.

Looking at the website it appears that the pricing is being set by sending a PATCH to the app record itself but on the API this results in a 405 (METHOD_NOT_ALLOWED)

Is it possible to set a price using the API, and if so what endpoint should I be sending to?

Okay I have combined my solutions for FastLane on an answer here. Thank you @GrayDev

Thanks to Grok v2 I have a possible solution. This is what it tells me to try:


According to the information available on Apple's App Store Connect API documentation, you can indeed set pricing for an app, but this is done through scheduled price changes rather than a direct pricing endpoint for immediate application. Here's how you can manage app pricing using the App Store Connect API:

Endpoint:

Scheduled Price Change for an App:

Endpoint: POST /v1/apps/{id}/priceSchedules

Request Format: To schedule a price change for an app, you would use the following structure:

json
{
  "data": {
    "attributes": {
      "startDate": "2024-12-31T00:00:00Z",
      "manualPrices": [
        {
          "territory": "USA",
          "priceTier": "TIER_1"
        }
      ]
    },
    "type": "appPriceSchedules"
  }
}

Explanation:

startDate:

The date when the price change should take effect. This needs to be in ISO 8601 format.

manualPrices:

An array of price changes for different territories. You specify the territory (country/region code) and the price tier.

territory:

ISO 3166-1 alpha-3 country code. For example, "USA" for the United States.

priceTier:

This is a string representing the price tier. Tiers range from TIER_1 to TIER_800 with possible additional higher tiers upon request. The exact mapping of these tiers to actual prices can be found in the App Store Connect web interface or through the GET /v1/pricePoints endpoint.

Additional Points:

Price Tiers:

The actual monetary value associated with each tier can vary by country due to currency and tax differences. You can fetch current price points and tiers for different territories using GET /v1/pricePoints or get price information for an app with GET /v1/apps/{id}/pricePoints.

Automatic Pricing:

If you don't specify manual prices for all territories, Apple will automatically generate prices for other territories based on your base territory's price, considering local taxes and currency conversions. However, if you specify a manual price for a territory, that price will be fixed and not automatically adjusted by Apple.

Permissions:

You'll need the appropriate role (like Account Holder, Admin, or App Manager) to use these endpoints.

Testing:

Before pushing changes live, it's advisable to test your API calls in a controlled environment or with a test app to ensure everything works as expected.

References:

This information is based on Apple's App Store Connect API documentation, particularly related to managing app pricing and availability:

For detailed API usage, including endpoints for price management, refer to the official documentation for App Store Connect API.

Remember, the exact behavior and available endpoints might evolve, so always check the latest documentation or Apple's developer forums for the most current practices.

I'm going to be honest, I asked this question in January of 2023 and never received an answer from Apple, at least not one that was worth a damn. I'm always told by App Review or Apple Employees to "ask on the forums", but I won't do that anymore.

I also won't "file a feedback" because it's been 2 years since I notified Apple that when using Xcode Cloud to auto increment your build numbers, sending in a manual build breaks the auto increment. 2 years. It's still an issue.

Apple doesn't care.

Thanks to all that replied. Hopefully the Grok solution is a winner.

Thanks to Grok v2 I have a possible solution

(Apparently “grok v2” is an LLM “AI” thing, in case anyone else is unfamiliar.)

I’m not impressed by the code it has given you. I think you’ll have more luck with the code posted by GrayDev in November.

I asked this question in January of 2023 and never received an answer from Apple, at least not one that was worth a damn.

Right, but you did get answers from the rest of us. I linked to my code for settings IAP pricing in July 2023, which you could have tried to repurpose but you didn’t. Then in November 2024 GrayDev posted code to do exactly what you want (and which is, as I suspected, very similar to my IAP code). Then ECDev1 posted a link to their version of that on Stackoverflow. You don’t seem to have acknowledged those posts at all. They will solve your problem; the “AI hallucination” won’t.

Ok, FINALLY! I have a solution. I had to write an email to TC's email then send in a playground for testing to get this resolved.

The issue was my JWT auth token. For every previous endpoint that I used I set the scope to the full URL and it worked fine. I did the same for this endpoint but that's what causes the 405.

I have an issue with the 405 status code because it's not a bad method error, it's a bad token error. Apple says it works as intended. But it should really be a 401 Unauthorized, which would correctly indicate that the token is the issue.

For anyone having this issue the scope for this endpoint should be the path only for the endpoint, or excluded. I was only able to get it to work by excluding the scope. Apple claims that it worked for them using the url.path

I suspect there are other endpoints with the same response issue so if all else fails, remove the scope from your token and try again.

Thanks to everyone who tried to help, I tried everything you suggested but in the end the issue was that a bad http status response sent me chasing an error in my code that did not exist.

I'm not going to mark any answers as accepted because even though I am now unblocked, I don't think the solution actually solves the problem. Creating an auth token shouldn't require special exceptions to get random endpoints to accept authorization, and a returned status code should correctly indicate the problem.

AppStoreConnect API - How to set pricing
 
 
Q