Unauthenticated 403 error while accessing any app store server api

We followed all step given in Docs but getting authenticate error for other apple account that I am using

Below is details of error my command: curl -v -H 'Authorization: Bearer eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjNCQzczUjlEV0MifQ.eyJpc3MiOiI2OWE2ZGU4ZS1iNGZhLTQ3ZTMtZTA1My01YjhjN2MxMWE0ZDEiLCJhdWQiOiJhcHBzdG9yZWNvbm5lY3QtdjEiLCJpYXQiOjE2ODc4NDIwNjA4NDksImV4cCI6MTY4Nzg0NTY2MDg0OSwiYmlkIjoiY29tLm9uZmVyZW5jZS5vbmZlcmVuY2VhcHAifQ.W8_vaEPZoinC-80bBq-g3XLkohb_FSPzGN4a4YfqJ_V1UnmBmrtz2GtBPHhlQRB1VJ7NE3n3BNAWUMJrD5AuEA' "https://api.storekit.itunes.apple.com/inApps/v1/transactions/340001235870976"

Error gettings

  • Trying 17.56.138.9...
  • TCP_NODELAY set
  • Connected to api.storekit.itunes.apple.com (17.56.138.9) port 443 (#0)
  • ALPN, offering h2
  • ALPN, offering http/1.1
  • successfully set certificate verify locations:
  • CAfile: /etc/ssl/cert.pem

CApath: none

  • TLSv1.2 (OUT), TLS handshake, Client hello (1):
  • TLSv1.2 (IN), TLS handshake, Server hello (2):
  • TLSv1.2 (IN), TLS handshake, Certificate (11):
  • TLSv1.2 (IN), TLS handshake, Server key exchange (12):
  • TLSv1.2 (IN), TLS handshake, Server finished (14):
  • TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
  • TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
  • TLSv1.2 (OUT), TLS handshake, Finished (20):
  • TLSv1.2 (IN), TLS change cipher, Change cipher spec (1):
  • TLSv1.2 (IN), TLS handshake, Finished (20):
  • SSL connection using TLSv1.2 / ECDHE-RSA-CHACHA20-POLY1305
  • ALPN, server accepted to use h2
  • Server certificate:
  • subject: businessCategory=Private Organization; jurisdictionCountryName=US; jurisdictionStateOrProvinceName=California; serialNumber=C0806592; C=US; ST=California; L=Cupertino; O=Apple Inc.; CN=commercegateway.itunes.apple.com
  • start date: May 16 16:44:52 2023 GMT
  • expire date: Nov 12 16:54:52 2023 GMT
  • subjectAltName: host "api.storekit.itunes.apple.com" matched cert's "api.storekit.itunes.apple.com"
  • issuer: C=US; O=Apple Inc.; CN=Apple Public EV Server RSA CA 2 - G1
  • SSL certificate verify ok.
  • Using HTTP2, server supports multi-use
  • Connection state changed (HTTP/2 confirmed)
  • Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
  • Using Stream ID: 1 (easy handle 0x7f9bed010800)

GET /inApps/v1/transactions/340001235870976 HTTP/2 Host: api.storekit.itunes.apple.com User-Agent: curl/7.64.1 Accept: / Authorization: Bearer eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjNCQzczUjlEV0MifQ.eyJpc3MiOiI2OWE2ZGU4ZS1iNGZhLTQ3ZTMtZTA1My01YjhjN2MxMWE0ZDEiLCJhdWQiOiJhcHBzdG9yZWNvbm5lY3QtdjEiLCJpYXQiOjE2ODc4NDIwNjA4NDksImV4cCI6MTY4Nzg0NTY2MDg0OSwiYmlkIjoiY29tLm9uZmVyZW5jZS5vbmZlcmVuY2VhcHAifQ.W8_vaEPZoinC-80bBq-g3XLkohb_FSPzGN4a4YfqJ_V1UnmBmrtz2GtBPHhlQRB1VJ7NE3n3BNAWUMJrD5AuEA

  • Connection state changed (MAX_CONCURRENT_STREAMS == 1024)!

< HTTP/2 401 < server: daiquiri/3.0.0 < date: Tue, 27 Jun 2023 05:34:00 GMT < content-type: text/plain < strict-transport-security: max-age=31536000; includeSubDomains < x-apple-jingle-correlation-key: Z4AC6TLUWQRJHHYNLGGL5L2EZA < x-daiquiri-instance: daiquiri:15824002:mr85p00it-hyhk03174701:7987:23RELEASE91:daiquiri-amp-commerce-clients-ext-001-mr < Unauthenticated

Request ID: Z4AC6TLUWQRJHHYNLGGL5L2EZA.0.0

  • Connection #0 to host api.storekit.itunes.apple.com left intact
  • Closing connection 0

Replies

In general we recommend using the App Store Server Library to call the App Store Server API, which can remove common issues like setting your validity time in milliseconds instead of seconds.