Method: externaltransactions.createexternaltransaction
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Yeni bir harici işlem oluşturur.
HTTP isteği
POST https://androidpublisher.googleapis.com/androidpublisher/v3/{parent=applications/*}/externalTransactions
URL, gRPC Kod Dönüştürme söz dizimini kullanır.
Yol parametreleri
Parametreler |
parent |
string
Zorunlu. Bu harici işlemin oluşturulacağı üst kaynak. Biçim: applications/{packageName}
|
Sorgu parametreleri
Parametreler |
externalTransactionId |
string
Zorunlu. Harici işlem için kullanılacak kimlik. Uygulamanın diğer tüm işlemleri için benzersiz olmalıdır. Bu değer 1-63 karakter uzunluğunda olmalı ve geçerli karakterler /a-zA-Z0-9_-/ olmalıdır. E-posta gibi kimliği tanımlayabilecek bilgileri (PII) depolamak için bu alanı kullanmayın. Bu alanda kimliği tanımlayabilecek bilgiler depolamaya çalışmak, isteklerin engellenmesine neden olabilir.
|
İstek içeriği
İstek metni, ExternalTransaction
öğesinin bir örneğini içerir.
Yanıt gövdesi
Başarılı olursa yanıt metni, yeni oluşturulmuş bir ExternalTransaction
örneği içerir.
Örnek
Aşağıda örnek bir istek verilmiştir:
curl \
-X POST \
'https://androidpublisher.googleapis.com/androidpublisher/v3/applications/com.example.app/externalTransactions?externalTransactionId=exampleExternalTransactionId' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
-H 'Content-Type: application/json' \
-d '{ \
"originalPreTaxAmount": { \
"currency": "USD", \
"priceMicros": "1000000" \
}, \
"originalTaxAmount": { \
"currency": "USD", \
"priceMicros": "100000" \
}, \
"transactionTime": "2023-05-05T12:00:00Z", \
"oneTimeTransaction": { \
"externalTransactionToken": "token-123" \
}, \
"userTaxAddress": { \
"regionCode": "US" \
} \
}'
Aşağıda örnek bir yanıt verilmiştir:
{
"createTime": "2023-04-20T14:23:18.121Z",
"currentPreTaxAmount": {
"currency": "USD",
"priceMicros": "12000000"
},
"currentTaxAmount": {
"currency": "USD",
"priceMicros": "1200000"
},
"externalTransactionId": "ext-trans-id-1234",
"oneTimeTransaction": {
"externalTransactionToken": "one-time-token-abc"
},
"originalPreTaxAmount": {
"currency": "USD",
"priceMicros": "15000000"
},
"originalTaxAmount": {
"currency": "USD",
"priceMicros": "1500000"
},
"packageName": "com.example.app",
"recurringTransaction": {
"externalSubscription": {
"subscriptionType": "RECURRING"
},
"externalTransactionToken": "recurring-token-xyz",
"initialExternalTransactionId": "ext-trans-id-5678",
"otherRecurringProduct": {}
},
"testPurchase": {},
"transactionProgramCode": 11,
"transactionState": "TRANSACTION_REPORTED",
"transactionTime": "2023-04-20T14:20:00.000Z",
"userTaxAddress": {
"regionCode": "US"
}
}
Yetkilendirme kapsamları
Aşağıdaki OAuth kapsamını gerektirir:
https://www.googleapis.com/auth/androidpublisher
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-07-26 UTC.
[null,null,["Son güncelleme tarihi: 2025-07-26 UTC."],[[["\u003cp\u003eCreates a new external transaction using an HTTP POST request to a specified URL.\u003c/p\u003e\n"],["\u003cp\u003eRequires providing path and query parameters, including \u003ccode\u003eparent\u003c/code\u003e to specify the app package and a unique \u003ccode\u003eexternalTransactionId\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe request body needs to contain an \u003ccode\u003eExternalTransaction\u003c/code\u003e object, while a successful response returns a newly created \u003ccode\u003eExternalTransaction\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization is needed using the \u003ccode\u003ehttps://www.googleapis.com/auth/androidpublisher\u003c/code\u003e OAuth scope.\u003c/p\u003e\n"]]],["This describes how to create an external transaction using a POST request to the specified URL. The URL includes a required `parent` path parameter representing the application's package name. It also requires an `externalTransactionId` query parameter that must be unique and follow specific character constraints. The request and response bodies utilize the `ExternalTransaction` format. The process is authorized through the `androidpublisher` OAuth scope. It uses gRPC Transcoding syntax.\n"],null,["# Method: externaltransactions.createexternaltransaction\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nCreates a new external transaction.\n\n### HTTP request\n\n`POST https://androidpublisher.googleapis.com/androidpublisher/v3/{parent=applications/*}/externalTransactions`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------|----------------------------------------------------------------------------------------------------------------------------|\n| `parent` | `string` Required. The parent resource where this external transaction will be created. Format: applications/{packageName} |\n\n### Query parameters\n\n| Parameters ||\n|-------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `externalTransactionId` | `string` Required. The id to use for the external transaction. Must be unique across all other transactions for the app. This value should be 1-63 characters and valid characters are /a-zA-Z0-9_-/. Do not use this field to store any Personally Identifiable Information (PII) such as emails. Attempting to store PII in this field may result in requests being blocked. |\n\n### Request body\n\nThe request body contains an instance of [ExternalTransaction](/android-publisher/api-ref/rest/v3/externaltransactions#ExternalTransaction).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [ExternalTransaction](/android-publisher/api-ref/rest/v3/externaltransactions#ExternalTransaction).\n\n### Sample\n\nThe following is a sample request: \n\n```json\ncurl \\\n -X POST \\\n 'https://androidpublisher.googleapis.com/androidpublisher/v3/applications/com.example.app/externalTransactions?externalTransactionId=exampleExternalTransactionId' \\\n -H 'Accept: application/json' \\\n -H 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \\\n -H 'Content-Type: application/json' \\\n -d '{ \\\n \"originalPreTaxAmount\": { \\\n \"currency\": \"USD\", \\\n \"priceMicros\": \"1000000\" \\\n }, \\\n \"originalTaxAmount\": { \\\n \"currency\": \"USD\", \\\n \"priceMicros\": \"100000\" \\\n }, \\\n \"transactionTime\": \"2023-05-05T12:00:00Z\", \\\n \"oneTimeTransaction\": { \\\n \"externalTransactionToken\": \"token-123\" \\\n }, \\\n \"userTaxAddress\": { \\\n \"regionCode\": \"US\" \\\n } \\\n }'\n```\n\nThe following is a sample response: \n\n```json\n{\n \"createTime\": \"2023-04-20T14:23:18.121Z\",\n \"currentPreTaxAmount\": {\n \"currency\": \"USD\",\n \"priceMicros\": \"12000000\"\n },\n \"currentTaxAmount\": {\n \"currency\": \"USD\",\n \"priceMicros\": \"1200000\"\n },\n \"externalTransactionId\": \"ext-trans-id-1234\",\n \"oneTimeTransaction\": {\n \"externalTransactionToken\": \"one-time-token-abc\"\n },\n \"originalPreTaxAmount\": {\n \"currency\": \"USD\",\n \"priceMicros\": \"15000000\"\n },\n \"originalTaxAmount\": {\n \"currency\": \"USD\",\n \"priceMicros\": \"1500000\"\n },\n \"packageName\": \"com.example.app\",\n \"recurringTransaction\": {\n \"externalSubscription\": {\n \"subscriptionType\": \"RECURRING\"\n },\n \"externalTransactionToken\": \"recurring-token-xyz\",\n \"initialExternalTransactionId\": \"ext-trans-id-5678\",\n \"otherRecurringProduct\": {}\n },\n \"testPurchase\": {},\n \"transactionProgramCode\": 11,\n \"transactionState\": \"TRANSACTION_REPORTED\",\n \"transactionTime\": \"2023-04-20T14:20:00.000Z\",\n \"userTaxAddress\": {\n \"regionCode\": \"US\"\n }\n}\n```\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/androidpublisher`"]]