- HTTP request
- Path parameters
- Request body
- Response body
- Authorization scopes
- PartialRefund
- FullRefund
- Try it!
Refunds or partially refunds an existing external transaction.
HTTP request
POST https://androidpublisher.googleapis.com/androidpublisher/v3/{name=applications/*/externalTransactions/*}:refund
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
name |
Required. The name of the external transaction that will be refunded. Format: applications/{packageName}/externalTransactions/{externalTransaction} |
Request body
The request body contains data with the following structure:
JSON representation |
---|
{ "refundTime": string, // Union field |
Fields | |
---|---|
refundTime |
Required. The time that the transaction was refunded. Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
Union field refund_type . Required. Type of external transaction refund. refund_type can be only one of the following: |
|
partialRefund |
A partial refund. |
fullRefund |
A full-amount refund. |
Response body
If successful, the response body contains an instance of ExternalTransaction
.
Sample
The following is a sample request:
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" \ }'
The following is a sample response:
{ "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" } } }
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/androidpublisher
PartialRefund
A partial refund of a transaction.
JSON representation |
---|
{
"refundId": string,
"refundPreTaxAmount": {
object ( |
Fields | |
---|---|
refundId |
Required. A unique id distinguishing this partial refund. If the refund is successful, subsequent refunds with the same id will fail. Must be unique across refunds for one individual transaction. |
refundPreTaxAmount |
Required. The pre-tax amount of the partial refund. Should be less than the remaining pre-tax amount of the transaction. |
FullRefund
This type has no fields.
A full refund of the remaining amount of a transaction.