Method: purchases.subscriptionsv2.revoke
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
사용자의 정기 결제 구매를 subscriptionsv2.revoke합니다.
HTTP 요청
POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/purchases/subscriptionsv2/tokens/{token}:revoke
URL은 gRPC 트랜스코딩 문법을 사용합니다.
경로 매개변수
매개변수 |
packageName |
string
필수 항목입니다. 이 정기 결제의 구매가 이루어진 애플리케이션의 패키지입니다 (예: 'com.some.thing').
|
token |
string
필수 항목입니다. 정기 결제를 구매했을 때 사용자 기기에 제공된 토큰입니다.
|
요청 본문
요청 본문에는 다음과 같은 구조의 데이터가 포함됩니다.
필드 |
revocationContext |
object (RevocationContext )
필수 항목입니다. 정기 결제 취소에 관한 추가 세부정보입니다.
|
응답 본문
성공한 경우 응답 본문은 비어 있습니다.
샘플
다음은 샘플 요청입니다.
curl -X POST \
'https://androidpublisher.googleapis.com/androidpublisher/v3/applications/com.example.myapp/purchases/subscriptionsv2/tokens/sample_purchase_token:revoke' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"revocationContext": {
"proratedRefund": {}
}
}'
승인 범위
다음 OAuth 범위가 필요합니다.
https://www.googleapis.com/auth/androidpublisher
RevocationContext
purchases.subscriptionsv2.revoke API의 취소 컨텍스트입니다.
JSON 표현 |
{
// Union field RefundType can be only one of the following:
"fullRefund": {
object (FullRefund )
},
"proratedRefund": {
object (ProratedRefund )
},
"itemBasedRefund": {
object (ItemBasedRefund )
}
// End of list of possible types for union field RefundType .
} |
필드 |
통합 필드 RefundType . 승인할 환불의 유형을 정합니다. 유효한 요청의 일환으로 환불 유형이 지정되어야 합니다. RefundType 은 다음 중 하나여야 합니다. |
fullRefund |
object (FullRefund )
선택사항입니다. 사용자가 정기 결제의 각 항목에 대해 최근 청구된 금액 전액을 환불받아야 하는 경우 사용합니다.
|
proratedRefund |
object (ProratedRefund )
선택사항입니다. 정기 결제의 남아 있는 기간을 기준으로 사용자가 결제한 금액의 일할 계산된 금액을 환불하려는 경우 사용합니다.
|
itemBasedRefund |
object (ItemBasedRefund )
선택사항입니다. 부가기능 항목이 포함된 정기 결제에서 특정 항목을 환불해야 하는 경우에 사용됩니다.
|
FullRefund
이 유형에는 필드가 없습니다.
RevocationContext의 환불 유형이 전액 환불인지 확인하는 데 사용됩니다.
ProratedRefund
이 유형에는 필드가 없습니다.
RevocationContext의 환불 유형이 일할 계산된 환불인지 확인하는 데 사용됩니다.
ItemBasedRefund
여러 항목이 포함된 정기 결제에서 취소할 특정 항목을 결정하는 데 사용됩니다.
JSON 표현 |
{
"productId": string
} |
필드 |
productId |
string
필수 항목입니다. 정기 결제가 부가기능이 포함된 정기 결제인 경우 취소할 정기 결제 항목의 제품 ID입니다.
|
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-26(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-26(UTC)"],[[["\u003cp\u003eRevoke a user's subscription purchase using the \u003ccode\u003esubscriptionsv2.revoke\u003c/code\u003e API.\u003c/p\u003e\n"],["\u003cp\u003eThe API requires the package name and purchase token in the request path.\u003c/p\u003e\n"],["\u003cp\u003eYou can optionally specify a full or prorated refund in the request body.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful revocation results in an empty response body.\u003c/p\u003e\n"],["\u003cp\u003eRequires the \u003ccode\u003ehttps://www.googleapis.com/auth/androidpublisher\u003c/code\u003e OAuth scope for authorization.\u003c/p\u003e\n"]]],["This document outlines the process for revoking a user's subscription purchase via the `subscriptionsv2.revoke` API. The `POST` request, sent to `https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/purchases/subscriptionsv2/tokens/{token}:revoke`, requires the application's package name and the user's subscription token. The request body must include a `revocationContext`, specifying either a `fullRefund` or `proratedRefund`. Successful requests yield an empty response. This API action also needs the `androidpublisher` authorization scope.\n"],null,["# Method: purchases.subscriptionsv2.revoke\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [RevocationContext](#RevocationContext)\n - [JSON representation](#RevocationContext.SCHEMA_REPRESENTATION)\n- [FullRefund](#FullRefund)\n- [ProratedRefund](#ProratedRefund)\n- [ItemBasedRefund](#ItemBasedRefund)\n - [JSON representation](#ItemBasedRefund.SCHEMA_REPRESENTATION)\n- [Try it!](#try-it)\n\nsubscriptionsv2.revoke a subscription purchase for the user.\n\n### HTTP request\n\n`POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/purchases/subscriptionsv2/tokens/{token}:revoke`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|---------------|------------------------------------------------------------------------------------------------------------------------------|\n| `packageName` | `string` Required. The package of the application for which this subscription was purchased (for example, 'com.some.thing'). |\n| `token` | `string` Required. The token provided to the user's device when the subscription was purchased. |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"revocationContext\": { object (/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/revoke#RevocationContext) } } ``` |\n\n| Fields ||\n|---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `revocationContext` | `object (`[RevocationContext](/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/revoke#RevocationContext)`)` Required. Additional details around the subscription revocation. |\n\n### Response body\n\nIf successful, the response body is empty.\n\n### Sample\n\nThe following is a sample request: \n\n```json\ncurl -X POST \\\n 'https://androidpublisher.googleapis.com/androidpublisher/v3/applications/com.example.myapp/purchases/subscriptionsv2/tokens/sample_purchase_token:revoke' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"revocationContext\": {\n \"proratedRefund\": {}\n }\n }'\n```\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/androidpublisher`\n\nRevocationContext\n-----------------\n\nRevocation context of the purchases.subscriptionsv2.revoke API.\n\n| JSON representation |\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { // Union field `RefundType` can be only one of the following: \"fullRefund\": { object (/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/revoke#FullRefund) }, \"proratedRefund\": { object (/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/revoke#ProratedRefund) }, \"itemBasedRefund\": { object (/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/revoke#ItemBasedRefund) } // End of list of possible types for union field `RefundType`. } ``` |\n\n| Fields ||\n|-------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Union field `RefundType`. Determines the type of refund that should be granted. A refund type must be specified as part of a valid request. `RefundType` can be only one of the following: ||\n| `fullRefund` | `object (`[FullRefund](/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/revoke#FullRefund)`)` Optional. Used when users should be refunded the full amount of latest charge on each item in the subscription. |\n| `proratedRefund` | `object (`[ProratedRefund](/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/revoke#ProratedRefund)`)` Optional. Used when users should be refunded a prorated amount they paid for their subscription based on the amount of time remaining in a subscription. |\n| `itemBasedRefund` | `object (`[ItemBasedRefund](/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/revoke#ItemBasedRefund)`)` Optional. Used when a specific item should be refunded in a subscription with add-on items. |\n\nFullRefund\n----------\n\nThis type has no fields.\nUsed to determine if the refund type in the RevocationContext is a full refund.\n\nProratedRefund\n--------------\n\nThis type has no fields.\nUsed to determine if the refund type in the RevocationContext is a prorated refund.\n\nItemBasedRefund\n---------------\n\nUsed to determine what specific item to revoke in a subscription with multiple items.\n\n| JSON representation |\n|---------------------------------|\n| ``` { \"productId\": string } ``` |\n\n| Fields ||\n|-------------|---------------------------------------------------------------------------------------------------------------------------|\n| `productId` | `string` Required. If the subscription is a subscription with add-ons, the product id of the subscription item to revoke. |"]]