A Apigee usa as variáveis de monetização para classificar, calcular a participação na receita e analisar dados. Se
você quer que as análises da Apigee mostrem as informações de monetização usando as variáveis, é possível melhorar os recursos de monetização
das suas transações.
Variáveis de monetização
Os nomes das variáveis de monetização são predefinidos, e não é possível criar, editar
nem excluir as variáveis. É possível atribuir as variáveis de solicitação ou resposta às
variáveis de monetização.
Esta tabela descreve as variáveis de monetização disponíveis na Apigee:
Variável de monetização
Tipo de dados
Descrição
moeda
String
Especifica a moeda de cálculo da receita de uma transação.
perUnitPriceMultiplier
Ponto flutuante
Especifica o fator (multiplicador) usado para multiplicar o custo por transação.
O custo por transação é especificado nos preços de taxas,
com base no consumo do plano de tarifas.
A multiplicação é realizada para uma transação apenas quando ela é
monetizável. Uma transação é passível de monetização quando alguma das seguintes condições
é atendida:
Quando a variável transactionSuccess é true.
Quando a variável transactionSuccess é NULL e
message.status.code é 2xx (sucesso).
revShareGrossPrice
Ponto flutuante
Especifica a receita da transação para calcular a participação do desenvolvedor. A Apigee calcula
o compartilhamento do desenvolvedor apenas se você tiver ativado a participação na receita no seu plano de tarifas.
transactionSuccess
boolean
Especifica se a transação deve gerar receita.
Quando a variável está definida como true, a transação é monetizada.
Quando a variável está definida como false, a transação não é monetizada.
Quando você não especifica essa variável, as transações são monetizadas com base no
valor do código de status HTTP disponível na variável message.status.code.
Quando o código de status HTTP da resposta é NULL ou >=300, a transação não é monetizada. Para todos os outros códigos de status, a transação é monetizada.
Exemplos de atribuição de valor
Os exemplos a seguir mostram como atribuir valores às variáveis de monetização:
moeda
O exemplo a seguir atribui o valor do elemento JSON booking[0].currency
na resposta à variável currency:
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-09-03 UTC."],[[["\u003cp\u003eThis documentation covers monetization variables for Apigee and Apigee hybrid, which are used for rating, calculating revenue share, and analytics within the platform.\u003c/p\u003e\n"],["\u003cp\u003eMonetization variable names are predefined and cannot be created, edited, or deleted, but you can assign either request or response variables to them, and override them via the DataCapture policy.\u003c/p\u003e\n"],["\u003cp\u003eThere are four main monetization variables: \u003ccode\u003ecurrency\u003c/code\u003e, \u003ccode\u003eperUnitPriceMultiplier\u003c/code\u003e, \u003ccode\u003erevShareGrossPrice\u003c/code\u003e, and \u003ccode\u003etransactionSuccess\u003c/code\u003e, each with specific data types and purposes related to transaction monetization and revenue sharing.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003etransactionSuccess\u003c/code\u003e variable determines if a transaction should be monetized, based on its boolean value or, if not set, on the HTTP status code.\u003c/p\u003e\n"],["\u003cp\u003eExamples are provided, demonstrating how to assign values to each of the monetization variables using the DataCapture policy, pulling data from JSON payloads and response headers.\u003c/p\u003e\n"]]],[],null,["# Capturing monetization data\n\n*This page\napplies to **Apigee** and **Apigee hybrid**.*\n\n\n*View [Apigee Edge](https://docs.apigee.com/api-platform/get-started/what-apigee-edge) documentation.*\n\n\nApigee uses the monetization variables for rating, calculating revenue share, and analytics. If\nyou want your Apigee analytics to show the monetization information. By using the monetization\nvariables, you can enhance the monetization capabilities of your transactions.\n\nMonetization variables\n----------------------\n\n\nThe monetization variable names are predefined, and you can't create, edit,\nor delete the variables. You can assign either request or response variables to the\nmonetization variables.\n| If you want to override monetization variables, you can do so by capturing them using the [DataCapture policy](/apigee/docs/api-platform/reference/policies/data-capture-policy).\n\nThis table describes the monetization variables available in Apigee:\n\n| **Note** :\n|\n| - The monetization variables are not visible in the Apigee's `Admin \u003e Data Collectors` page.\n| - The monetization variables are case sensitive.\n| - Apart from the variable names listed in the table, you cannot provide any other names for the monetization variables.\n| - The monetization variables are not listed in the [organizations.datacollectors.list](/apigee/docs/reference/apis/apigee/rest/v1/organizations.datacollectors/list) API.\n\nValue assignment examples\n-------------------------\n\nThe following examples show how to assign values to the monetization variables: \n\n### currency\n\nThe following example assigns the value of the `booking[0].currency` JSON element\nin the response to the `currency` variable: \n\n```gdscript\n\u003cCapture\u003e\n \u003cCollect\u003e\n \u003cSource\u003eresponse\u003c/Source\u003e\n \u003cJSONPayload\u003e\n \u003cJSONPath\u003ebooking[0].currency\u003c/JSONPath\u003e\n \u003c/JSONPayload\u003e\n \u003c/Collect\u003e\n \u003cDataCollector scope=\"monetization\"\u003ecurrency\u003c/DataCollector\u003e\n\u003c/Capture\u003e\n \n```\n\n### perUnitPriceMultiplier\n\nThe following example assigns the value of the `booking[0].factor` JSON element in the response to the `perUnitPriceMultiplier` variable: \n\n```gdscript\n\u003cCapture\u003e\n \u003cCollect\u003e\n \u003cSource\u003eresponse\u003c/Source\u003e\n \u003cJSONPayload\u003e\n \u003cJSONPath\u003ebooking[0].factor\u003c/JSONPath\u003e\n \u003c/JSONPayload\u003e\n \u003c/Collect\u003e\n \u003cDataCollector scope=\"monetization\"\u003eperUnitPriceMultiplier\u003c/DataCollector\u003e\n\u003c/Capture\u003e\n \n```\n\n### revShareGrossPrice\n\nThe following example assigns the value of the `minPrice` variable in the response header to the `revShareGrossPrice` variable: \n\n```smarty\n\u003cCapture\u003e\n \u003cCollect\u003e\n \u003cSource\u003eresponse\u003c/Source\u003e\n \u003cHeader name=\"minPrice\"\u003e\n \u003cPattern ignoreCase=\"true\"\u003e{$}\u003c/Pattern\u003e\n \u003c/Header\u003e\n \u003c/Collect\u003e\n \u003cDataCollector scope=\"monetization\"\u003erevShareGrossPrice\u003c/DataCollector\u003e\n\u003c/Capture\u003e\n \n```\n\n### transactionSuccess\n\nThe following example assigns the value of the `bookingStatus` variable in the response header to the `transactionSuccess` variable: \n\n```smarty\n\u003cCapture\u003e\n \u003cCollect\u003e\n \u003cSource\u003eresponse\u003c/Source\u003e\n \u003cHeader name=\"bookingStatus\"\u003e\n \u003cPattern ignoreCase=\"true\"\u003e{$}\u003c/Pattern\u003e\n \u003c/Header\u003e\n \u003c/Collect\u003e\n \u003cDataCollector scope=\"monetization\"\u003etransactionSuccess\u003c/DataCollector\u003e\n\u003c/Capture\u003e\n```"]]