You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

App Store Server API交易历史与客户订单ID查询接口返回404问题排查咨询

Troubleshooting 404 Errors with App Store Server API Transaction Endpoints

I’ve dealt with similar head-scratching 404s when working with App Store Server APIs, so let’s walk through the most likely fixes and checks for your scenario:

First: Address the lookup/customer_order_id Endpoint 404

You noted App Store staff said the inApps/v1/lookup/customer_order_id endpoint would launch this year—this 404 is almost certainly because it hasn’t been rolled out publicly yet. WWDC announcements often preview features that aren’t immediately available, so you’ll need to wait until Apple officially enables this endpoint (keep an eye on their developer docs for updates). No configuration fixes will help here; it’s just not ready yet.

Troubleshooting the history/{transactionid} Endpoint 404

For the transaction history endpoint returning 404, run through these critical checks:

  • Validate the Transaction ID: Ensure you’re using a full, valid transaction ID (not an order ID or truncated value). These IDs are case-sensitive, so even a single wrong character will throw a 404. Cross-check the ID against the receipt data or App Store Connect records for the user’s purchase.
  • Confirm Environment & Endpoint: If you’re testing with sandbox purchases, you must use the sandbox API URL: https://api.storekit-sandbox.itunes.apple.com/inApps/v1/history/{transactionid}. Using the production endpoint for sandbox transactions will result in a 404 every time.
  • Check Authentication: Your request must include a properly signed JWT in the Authorization header. Double-check that:
    • The JWT uses the correct private key from your App Store Connect account
    • The token has the TransactionHistory scope
    • The audience is set to appstoreconnect-v1
    • The token isn’t expired
      Invalid auth can sometimes return 404 instead of the more intuitive 401/403, so don’t skip this step.
  • Verify Transaction Availability: Apple retains transaction history for a limited period. Make sure the transaction you’re querying is within the retention window outlined in the API docs.
  • Check for URL Typos: Even a small mistake in the endpoint path (like extra slashes or misspelled segments) will lead to 404. Confirm your URL matches exactly: https://api.storekit.itunes.apple.com/inApps/v1/history/{transactionid}

Extra Debugging Tips

  • Dig into Request Details: Your curl verbose output shows a valid HTTP/2 connection, but double-check that all required headers are present (beyond just the auth token). Apple’s APIs are strict about header formatting.
  • Cross-Reference with App Store Connect: Look up the transaction ID in App Store Connect’s Sales & Trends section. If it doesn’t exist there, the API won’t find it either—this could mean the purchase was refunded, canceled, or never processed properly.

Your curl response shows a 404 with an empty body, which aligns with either an unreleased endpoint (for lookup) or invalid/missing transaction data (for history).

内容的提问来源于stack exchange,提问作者zangw

火山引擎 最新活动