Contents

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

NameTypeDescription
transactionId Requiredstring

The transaction identifier of the auto-renewable subscription to cancel.

Response Codes

StatusReasonTypeDescription
200OK
Content-Type: application/json
SubscriptionCancelResponse

Success

400Bad Request
Content-Type: application/json
(NullRequestInfoError | InvalidAppAccountTokenError | NullRequestReferenceIDError | InvalidRequestReferenceIDError | InvalidConsistencyTokenError | InvalidStorefrontError | MismatchedStorefrontError | OperationNotAllowedError | MalformedPayloadError)
401Unauthorized
403Forbidden
Content-Type: application/json
(SubscriptionDoesNotExistError | SubscriptionNotEligibleError | ProductNotOwnedError)
404Not Found
Content-Type: application/json
TransactionIdNotFoundError
429
Content-Type: application/json
RateLimitExceededError
500Internal 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.

See Also

Subscription cancellation from the server