Method: purchases.subscriptions.defer
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
지정된 미래의 만료 시점까지 사용자의 정기 결제 구매를 연기합니다.
HTTP 요청
POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:defer
URL은 gRPC 트랜스코딩 문법을 사용합니다.
경로 매개변수
매개변수 |
packageName |
string
이 정기 결제를 구매한 애플리케이션의 패키지 이름입니다 (예: 'com.some.thing').
|
subscriptionId |
string
구매한 정기 결제 ID입니다 (예: 'monthly001').
|
token |
string
정기 결제를 구매했을 때 사용자 기기에 제공된 토큰입니다.
|
요청 본문
요청 본문에는 다음과 같은 구조의 데이터가 포함됩니다.
필드 |
deferralInfo |
object (SubscriptionDeferralInfo )
정기 결제의 새로운 희망 만료 시간에 관한 정보입니다.
|
응답 본문
purchases.subscriptions.defer API의 ���답입니다.
���공한 경우 응답 본문은 다음과 같은 구조의 데이터를 포함합니다.
JSON 표현 |
{
"newExpiryTimeMillis": string
} |
필드 |
newExpiryTimeMillis |
string (int64 format)
정기 결제의 새 만료 시간(에포크 이후 밀리초 단위)입니다.
|
샘플
다음은 샘플 요청입니다.
curl -X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"deferralInfo": {
"desiredExpiryTimeMillis": "1735689600000",
"expectedExpiryTimeMillis": "1704067200000"
}
}' \
'https://androidpublisher.googleapis.com/androidpublisher/v3/applications/com.example.myapp/purchases/subscriptions/monthly.premium.v1/tokens/aBcDeFgHiJkLmNoPqRsTuVwXyZaBcDeFgHiJkLmNoPqRsTuVwXyZ.1234567890:defer'
다음은 샘플 응답입니다.
{
"newExpiryTimeMillis": "1776004800000"
}
승인 범위
다음 OAuth 범위가 필요합니다.
https://www.googleapis.com/auth/androidpublisher
SubscriptionDeferralInfo
SubscriptionDeferralInfo에는 정기 결제 구매를 미래의 만료 시간으로 연기하는 데 필요한 데이터가 포함됩니다.
JSON 표현 |
{
"expectedExpiryTimeMillis": string,
"desiredExpiryTimeMillis": string
} |
필드 |
expectedExpiryTimeMillis |
string (int64 format)
정기 결제의 예상 만료 시간입니다. 정기 결제의 현재 만료 시간이 여기에 지정된 값이 아닌 경우 연기가 되지 않습니다.
|
desiredExpiryTimeMillis |
string (int64 format)
정기 결제에 할당할 다음 희망 만료 시간(에포크 이후 밀리초 단위)입니다. 지정된 시간은 정기 결제의 현재 만료 시간 후의 시간이어야 합니다.
|
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 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\u003eDefers a user's subscription purchase to a specified future expiration time using the \u003ccode\u003epurchases.subscriptions.defer\u003c/code\u003e API.\u003c/p\u003e\n"],["\u003cp\u003eRequires the \u003ccode\u003epackageName\u003c/code\u003e, \u003ccode\u003esubscriptionId\u003c/code\u003e, and purchase \u003ccode\u003etoken\u003c/code\u003e as path parameters for the HTTP request.\u003c/p\u003e\n"],["\u003cp\u003eThe request body includes \u003ccode\u003edeferralInfo\u003c/code\u003e containing the \u003ccode\u003eexpectedExpiryTimeMillis\u003c/code\u003e and the \u003ccode\u003edesiredExpiryTimeMillis\u003c/code\u003e for the subscription.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful responses provide the \u003ccode\u003enewExpiryTimeMillis\u003c/code\u003e for the deferred subscription.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization requires the \u003ccode\u003ehttps://www.googleapis.com/auth/androidpublisher\u003c/code\u003e OAuth scope.\u003c/p\u003e\n"]]],["This outlines the process of deferring a user's subscription purchase using a `POST` request to the specified URL, including `packageName`, `subscriptionId`, and `token` as path parameters. The request body, containing a `deferralInfo` object, specifies the `expectedExpiryTimeMillis` and `desiredExpiryTimeMillis`. Successful deferrals return a response with the `newExpiryTimeMillis`. This process requires `https://www.googleapis.com/auth/androidpublisher` authorization scope.\n"],null,["- [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 - [JSON representation](#body.SubscriptionPurchasesDeferResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [SubscriptionDeferralInfo](#SubscriptionDeferralInfo)\n - [JSON representation](#SubscriptionDeferralInfo.SCHEMA_REPRESENTATION)\n- [Try it!](#try-it)\n\nDefers a user's subscription purchase until a specified future expiration time.\n\nHTTP request\n\n`POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:defer`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\nPath parameters\n\n| Parameters ||\n|------------------|-------------------------------------------------------------------------------------------------------------------------|\n| `packageName` | `string` The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). |\n| `subscriptionId` | `string` The purchased subscription ID (for example, 'monthly001'). |\n| `token` | `string` The token provided to the user's device when the subscription was purchased. |\n\nRequest body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"deferralInfo\": { object (/android-publisher/api-ref/rest/v3/purchases.subscriptions/defer#SubscriptionDeferralInfo) } } ``` |\n\n| Fields ||\n|----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `deferralInfo` | `object (`[SubscriptionDeferralInfo](/android-publisher/api-ref/rest/v3/purchases.subscriptions/defer#SubscriptionDeferralInfo)`)` The information about the new desired expiry time for the subscription. |\n\nResponse body Response for the purchases.subscriptions.defer API.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|-------------------------------------------|\n| ``` { \"newExpiryTimeMillis\": string } ``` |\n\n| Fields ||\n|-----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `newExpiryTimeMillis` | `string (`[int64](https://developers.google.com/discovery/v1/type-format)` format)` The new expiry time for the subscription in milliseconds since the Epoch. |\n\nSample\n\nThe following is a sample request: \n\n```json\ncurl -X POST \\\n -H \"Accept: application/json\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"deferralInfo\": {\n \"desiredExpiryTimeMillis\": \"1735689600000\",\n \"expectedExpiryTimeMillis\": \"1704067200000\"\n }\n }' \\\n 'https://androidpublisher.googleapis.com/androidpublisher/v3/applications/com.example.myapp/purchases/subscriptions/monthly.premium.v1/tokens/aBcDeFgHiJkLmNoPqRsTuVwXyZaBcDeFgHiJkLmNoPqRsTuVwXyZ.1234567890:defer'\n```\n\nThe following is a sample response: \n\n```json\n{\n \"newExpiryTimeMillis\": \"1776004800000\"\n}\n```\n\nAuthorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/androidpublisher`\n\nSubscriptionDeferralInfo A SubscriptionDeferralInfo contains the data needed to defer a subscription purchase to a future expiry time.\n\n| JSON representation |\n|-----------------------------------------------------------------------------------|\n| ``` { \"expectedExpiryTimeMillis\": string, \"desiredExpiryTimeMillis\": string } ``` |\n\n| Fields ||\n|----------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `expectedExpiryTimeMillis` | `string (`[int64](https://developers.google.com/discovery/v1/type-format)` format)` The expected expiry time for the subscription. If the current expiry time for the subscription is not the value specified here, the deferral will not occur. |\n| `desiredExpiryTimeMillis` | `string (`[int64](https://developers.google.com/discovery/v1/type-format)` format)` The desired next expiry time to assign to the subscription, in milliseconds since the Epoch. The given time must be later/greater than the current expiry time for the subscription. |"]]