Contents

Revoke Subscription

Immediately cancel a customer’s subscription and all the items that are included in the subscription, and request a full or prorated refund.

URL

POST https://api.storekit.itunes.apple.com/advancedCommerce/v1/subscription/revoke/{transactionId}

Sandbox URL

POST https://api.storekit-sandbox.itunes.apple.com/advancedCommerce/v1/subscription/revoke/{transactionId}

Path Parameters

NameTypeDescription
transactionId Requiredstring

The transaction identifier of the auto-renewable subscription to revoke. Use the subscription’s original transaction ID or any subsequent transaction ID of a transaction related to the subscription.

Response Codes

StatusReasonTypeDescription
200OK
Content-Type: application/json
SubscriptionRevokeResponse

Request succeeded.

400Bad Request
Content-Type: application/json
(RepeatedRequestReferenceIdError | NullRequestInfoError | InvalidAppAccountTokenError | NullRequestReferenceIDError | InvalidRequestReferenceIDError | InvalidConsistencyTokenError | InvalidStorefrontError | MismatchedStorefrontError | MismatchedStorefrontError | OperationNotAllowedError | MalformedPayloadError | SimulateRefundDeclineOnlyInSandboxError | RefundAmountWithoutCustomError | NullRefundRiskingError | InvalidRefundTypeError | InvalidRefundReasonError | NegativeRefundAmountError | NullRefundAmountError | NullRefundReasonError | NullRefundTypeError | PendingRefundError | RevokeOnInactiveSubscriptionError)

401Unauthorized

The JSON Web Token (JWT) in the authorization header is invalid. For more information, see Authorizing API requests from your server.

403Forbidden
Content-Type: application/json
(SubscriptionDoesNotExistError | SubscriptionNotEligibleError | ProductNotOwnedError | InsufficientFundsError | AlreadyRefundedError | TransactionNotRefundableError)

404Not Found
Content-Type: application/json
TransactionIdNotFoundError

429
Content-Type: application/json
RateLimitExceededError

The request exceeded the rate limit. For more information, see Identifying rate limits for Advanced Commerce APIs.

500Internal Server Error
Content-Type: application/json
(GeneralInternalError | GeneralInternalRetryableError)

Server error. Try again later.

Mentioned in

Discussion

When this endpoint succeeds, the system sets the subscription’s auto-renew status to false, and revokes the subscription with a full or prorated refund. The App Store Server Notifications sends a REFUND notificationType to your App Store Server Notifications V2 endpoint. Check the revocationDate property in the notification’s JWSTransactionDecodedPayload. Turn off service for the subscription and its items as of the revocation date. Don’t turn off service to the subscription until you receive the notification.

To cancel a subscription at the end of the current period instead, see Cancel a 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.

HTTP Body

See Also

Subscription revocation from the server