Method: externaltransactions.refundexternaltransaction

기존 외부 거래를 환불하거나 부분적으로 환불합니다.

HTTP 요청

POST https://androidpublisher.googleapis.com/androidpublisher/v3/{name=applications/*/externalTransactions/*}:refund

URL은 gRPC 트랜스코딩 구문을 사용합니다.

경로 매개변수

매개변수
name

string

필수 항목입니다. 환불될 외부 거래의 이름입니다. 형식: applications/{packageName}/externalTransactions/{externalTransaction}

요청 본문

요청 본문에는 다음과 같은 구조의 데이터가 포함됩니다.

JSON 표현
{
  "refundTime": string,

  // The following is a list of mutually exclusive fields. At most one of the
  // fields will be set in a response:
  "partialRefund": {
    object (PartialRefund)
  },
  "fullRefund": {
    object (FullRefund)
  }
  // End of mutually exclusive fields.
}
필드
refundTime

string (Timestamp format)

필수 항목입니다. 거래가 환불된 시간입니다.

생성된 출력은 항상 Z-정규화되고 소수점 이하 0, 3, 6 또는 9자리인 RFC 3339를 사용합니다. 'Z' 이외의 오프셋도 허용됩니다. 예를 들면 "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" 또는 "2014-10-02T15:01:23+05:30"입니다.

필수 항목입니다. 외부 거래 환불 유형입니다. 다음은 상호 배타적인 필드 목록입니다. 응답에서 필드가 최대 하나 설정됩니다.
partialRefund

object (PartialRefund)

부분 환불입니다.

fullRefund

object (FullRefund)

전액 환불입니다.

상호 배타적인 필드의 끝입니다.

응답 본문

성공한 경우 응답 본문에 ExternalTransaction의 인스턴스가 포함됩니다.

샘플

다음은 샘플 요청입니다.

curl \
  -X POST \
  'https://androidpublisher.googleapis.com/androidpublisher/v3/applications/com.example.app/externalTransactions/foo:refund' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
  -H 'Content-Type: application/json' \
  -d '{ \
    "partialRefund": { \
      "refundId": "my_refund_id", \
      "refundPreTaxAmount": { \
        "currency": "USD", \
        "priceMicros": "10120000" \
      } \
    }, \
    "refundTime": "2023-10-20T16:43:32.852Z" \
  }'

다음은 샘플 응답입니다.

{
  "externalTransactionId": "1234567890123456789012345678901234567890123456789012345678901234",
  "originalPreTaxAmount": {
    "currency": "USD",
    "priceMicros": "1990000"
  },
  "originalTaxAmount": {
    "currency": "USD",
    "priceMicros": "11400000"
  },
  "packageName": "com.example.app",
  "transactionState": "TRANSACTION_CANCELED",
  "transactionTime": "2023-04-01T12:00:00Z",
  "userTaxAddress": {
    "regionCode": "US"
  },
  "createTime": "2023-04-01T11:55:00Z",
  "currentPreTaxAmount": {
    "currency": "USD",
    "priceMicros": "0"
  },
  "currentTaxAmount": {
    "currency": "USD",
    "priceMicros": "0"
  },
  "testPurchase": {},
  "recurringTransaction": {
    "initialExternalTransactionId": "9876543210987654321098765432109876543210987654321098765432109876",
    "externalSubscription": {
      "subscriptionType": "RECURRING"
    }
  }
}

승인 범위

다음 OAuth 범위가 필요합니다.

  • https://www.googleapis.com/auth/androidpublisher

PartialRefund

거래의 부분 환불입니다.

JSON 표현
{
  "refundId": string,
  "refundPreTaxAmount": {
    object (Price)
  }
}
필드
refundId

string

필수 항목입니다. 이 부분 환불을 구별하는 고유 ID입니다. 환불에 성공하면 동일한 ID로 후속 환불이 실패합니다. 하나의 개별 거래에 대한 환불에서 고유해야 합니다.

refundPreTaxAmount

object (Price)

필수 항목입니다. 세전 부분 환불 금액입니다. 남은 세전 거래 금액보다 적어야 합니다.

FullRefund

이 유형에는 필드가 없습니다.

거래의 남은 금액을 전액 환불합니다.