Claim Seat
Claim a seat for a customer in a group subscription that uses developer-hosted invitations.
URL
POST https://api.storekit.apple.com/groups/v1/transactions/{originalTransactionId}/seatsSandbox URL
POST https://api.storekit-sandbox.apple.com/groups/v1/transactions/{originalTransactionId}/seatsPath Parameters
| Name | Type | Description |
|---|---|---|
originalTransactionId Required | originalTransactionId | The original transaction identifier of the group purchaser’s subscription. |
Response Codes
| Status | Reason | Type | Description |
|---|---|---|---|
| 200 | OK Content-Type: application/json | ClaimSeatResponse | Request succeeded. |
| 400 | Bad Request Content-Type: application/json | (InvalidTransactionIdError | InvalidRequestIdentifierError | AppTransactionIdNotSupportedError | FamilyTransactionNotSupportedError | BundleTransactionIdNotSupportedError | NoAvailableSeatsError | TransactionNotDevManagedGroupError) | Invalid request. See the error code for more information. |
| 401 | Unauthorized | The JSON Web Token (JWT) in the authorization header is invalid. For more information, see Generating JSON Web Tokens for API requests. | |
| 403 | Forbidden Content-Type: application/json | SubscriptionNotActiveError | The subscription isn’t active. |
| 404 | Not Found Content-Type: application/json | (OriginalTransactionIdNotFoundError | AppTransactionIdNotFoundError) | The original transaction identifier or the app transaction identifier wasn’t found. |
| 429 | Content-Type: application/json | RateLimitExceededError | The request exceeded the rate limit. |
| 500 | Internal Server Error Content-Type: application/json | (GeneralInternalError | GeneralInternalRetryableError) | Server error. Try again later. |
Mentioned in
Discussion
Call this endpoint only for an active group subscription that uses developer-hosted invitations, where the invitationManagement value in the purchaser’s transaction is DEVELOPER. Members of these groups don’t receive transactions, so your server keeps the record of who has access. Claim a seat for each member other than the purchaser to tell the App Store that the seat is occupied.
When a customer accepts an invitation to join a group in your app, call this endpoint with a ClaimSeatRequest. The response, ClaimSeatResponse, contains a seatClaimId that identifies the seat claim. Store the seatClaimId with your record of the member. You need it to unclaim or associate the seat, and the App Store uses it to identify seats that it unclaims.
Make claims safe to repeat
The requestIdentifier in the request makes the claim safe to repeat. Generate a new requestIdentifier for each claim, and save it before you call this endpoint. If a request fails or times out, call the endpoint again with the same requestIdentifier. If the original request claimed a seat, the App Store returns that seatClaimId, rather than claiming another seat. A request with a new requestIdentifier claims a new seat.
Associate the customer with the seat
If you know the appTransactionId of the customer who occupies the seat when you claim it, include it in the request. The App Store associates the customer with the seat as part of the claim. If you learn the appTransactionId after you claim the seat, call the Associate Seat endpoint instead.
Claim seats only when seats are available
You can claim a seat only when the subscription has a seat available. If it doesn’t, the endpoint returns a NoAvailableSeatsError. To get the number of available seats, call the Get Seat Info endpoint.
If the group purchaser reduces the number of seats, the App Store doesn’t unclaim any seats when the subscription renews, so the number of claimed seats can exceed the number of seats in the subscription. Call the Unclaim Seat endpoint to release seats until the number of claimed seats is lower than the number of seats in the subscription, and then claim new seats.
HTTP Body
The request body that contains a request identifier, and optionally, the app transaction identifier of the customer who occupies the seat.