Cancel a Subscription
Turn off automatic renewal to cancel a customer’s auto-renewable subscription.
URL
POST https://api.storekit.itunes.apple.com/advancedCommerce/v1/subscription/cancel/{transactionId}Sandbox URL
POST https://api.storekit-sandbox.itunes.apple.com/advancedCommerce/v1/subscription/cancel/{transactionId}Path Parameters
| Name | Type | Description |
|---|---|---|
transactionId Required | string | The transaction identifier of the auto-renewable subscription to cancel. |
Response Codes
| Status | Reason | Type | Description |
|---|---|---|---|
| 200 | OK Content-Type: application/json | SubscriptionCancelResponse | Success |
| 400 | Bad Request Content-Type: application/json | (NullRequestInfoError | InvalidAppAccountTokenError | NullRequestReferenceIDError | InvalidRequestReferenceIDError | InvalidConsistencyTokenError | InvalidStorefrontError | MismatchedStorefrontError | OperationNotAllowedError | MalformedPayloadError) | |
| 401 | Unauthorized | ||
| 403 | Forbidden Content-Type: application/json | (SubscriptionDoesNotExistError | SubscriptionNotEligibleError | ProductNotOwnedError) | |
| 404 | Not Found Content-Type: application/json | TransactionIdNotFoundError | |
| 429 | Content-Type: application/json | RateLimitExceededError | |
| 500 | Internal Server Error Content-Type: application/json | (GeneralInternalError | GeneralInternalRetryableError) |
Mentioned in
Discussion
When this endpoint succeeds, the system sets the subscription’s auto-renew status to false and the subscription doesn’t renew at the next renewal period. The customer continues to have access to the subscription until the end of the current period.
To immediately cancel a subscription instead, see Revoke Subscription.
Refer to the Advanced Commerce API Addendum to learn the use cases for the Cancel a Subscription, Revoke Subscription, and Request Transaction Refund APIs.
Example request and response
HTTP Body
The request body that includes information about the subscription to cancel.