Skip to content

Commit e0c2faf

Browse files
committed
docs(readme): add more validation notes to readme
1 parent 2c35c74 commit e0c2faf

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

README.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,17 @@ func main() {
5858

5959
- Validate the receipt
6060
- One option could be to validate the receipt with the App Store server through `GetTransactionInfo` API, and then check the `transactionId` in the response matches the one you are looking for.
61-
61+
- The App Store Server API differentiates between a sandbox and a production environment based on the base URL:
62+
- Use https://api.storekit.itunes.apple.com/ for the production environment.
63+
- Use https://api.storekit-sandbox.itunes.apple.com/ for the sandbox environment.
64+
- If you're unsure about the environment, follow these steps:
65+
- Initiate a call to the endpoint using the production URL. If the call is successful, the transaction identifier is associated with the production environment.
66+
- If you encounter an error code `4040010`, indicating a `TransactionIdNotFoundError`, make a call to the endpoint using the sandbox URL.
67+
- [Handle exceeded rate limits gracefully](https://developer.apple.com/documentation/appstoreserverapi/identifying_rate_limits)
68+
- If you exceed a per-hour limit, the API rejects the request with an HTTP 429 response, with a RateLimitExceededError in the body. Consider the following as you integrate the API:
69+
- If you periodically call the API, throttle your requests to avoid exceeding the per-hour limit for an endpoint.
70+
- Manage the HTTP 429 RateLimitExceededError in your error-handling process. For example, log the failure and queue the job to process it again at a later time.
71+
- Check the Retry-After header if you receive the HTTP 429 error. This header contains a UNIX time, in milliseconds, that informs you when you can next send a request.
6272
- Error handling
6373
- handler error per [apple store server api error](https://developer.apple.com/documentation/appstoreserverapi/error_codes) document
6474
- [error definition](./error.go)

0 commit comments

Comments
 (0)