API 제품에 개발자 구독을 적용하려면 MonetizationLimitsCheck 정책을 API 프록시에 연결하세요. 특히 API에 액세스하는 앱 개발자가 관련 API 제품에 대한 구독을 구매하지 않은 경우 정책이 트리거됩니다.
이 경우 monetizationLimitsCheck 정책은 결함을 유발하고 API 호출을 차단합니다.
프록시 호출 실행 중에 가져온 API 제품에 대한 수익 창출 요금제가 없는 경우 제품은 수익 창출이 아닌 것으로 간주되고 monetizationLimitsCheck 정책은 더 이상 데이터를 가져오지 않으며 정책이 적용되지 않습니다.
MonetizationLimitsCheck 정책 디버깅 및 mint 흐름 변수 참조에 설명된 대로 API 프록시에 MonetizationLimitsCheck 정책을 연결하면 mint.limitscheck.* 및 mint.subscription_* 흐름 변수가 채워집니다.
다음 방법 중 하나로 MonetizationLimitsCheck 정책을 API 프록시에 연결합니다.
프록시 만들기 마법사를 사용하여 API 프록시를 만들 때 다음 그림과 같이 일반 정책 페이지에서 수익 창출 한도 적용을 선택합니다.
API 프록시를 개발할 때 다음 그림과 같이 API 프록시 PreFlow의 요청 흐름에 VerifyAPIKey 또는 VerifyAccessToken 정책 뒤에 MonetizationLimitsCheckPolicy를 연결합니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-19(UTC)"],[[["\u003cp\u003eThis documentation applies to both Apigee and Apigee hybrid platforms, focusing on enforcing monetization limits within these environments.\u003c/p\u003e\n"],["\u003cp\u003eMonetization in Apigee utilizes the VerifyAPIKey or VerifyAccessToken policies to identify if an incoming request is monetizable based on the active published rate plan.\u003c/p\u003e\n"],["\u003cp\u003eThe MonetizationLimitsCheck policy is used to enforce developer subscriptions to API products, triggering a fault and blocking API calls if a subscription is absent.\u003c/p\u003e\n"],["\u003cp\u003eQuota policies can be attached to API proxies to enforce request limits for API products, with the option to configure quotas at the API product level for greater control.\u003c/p\u003e\n"],["\u003cp\u003eThe Quota policy requires the \u003ccode\u003e<UseQuotaConfigInAPIProduct>\u003c/code\u003e element to utilize the defined API product quota configuration, which will take precedence over any other configured values in the Quota policy itself.\u003c/p\u003e\n"]]],[],null,["# Enforce monetization limits in API proxies\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\nThis page describes how to enforce monetization limits by attaching policies to API proxies in a\nmonetized API product.\n\nAdd an authentication policy\n----------------------------\n\n\nApigee monetization uses the\n[VerifyAPIKey\npolicy](/apigee/docs/api-platform/reference/policies/verify-api-key-policy) or the\n[VerifyAccessToken operation of the OAuth2 policy](/apigee/docs/api-platform/reference/policies/oauthv2-policy#verifyingaccesstokens) to\ndetermine if an incoming request is monetizable by checking for the active published rate plan.\n\n\nAttach the policy to the API proxy using the Apigee UI or the API. See\n[Editing an API proxy](/apigee/docs/api-platform/develop/ui-edit-proxy) for\ninformation on editing a proxy.\n\n\nSee also:\n\n- [Attaching a policy to a flow](/apigee/docs/api-platform/develop/attaching-and-configuring-policies-management-ui#attaching-a-policy-to-a-flow)\n- [Verifying access tokens](/apigee/docs/api-platform/security/oauth/using-access-tokens)\n- [Monitoring and debugging the authentication policy](/apigee/docs/api-platform/monetization/debug-trace#auth) using Debug\n\nEnforce developer subscriptions on API products\n-----------------------------------------------\n\n\nAttach the\n[MonetizationLimitsCheck policy](/apigee/docs/api-platform/reference/policies/monetization-limits-check-policy) to API proxies to enforce developer subscriptions on\nthe API product:\n\n- If no monetization rate plan exists for the API product fetched during the proxy call execution, the product is deemed non-monetized, the MonetizationLimitsCheck policy does not fetch any further data, and the policy has no effect.\n- If a rate plan is found but a subscription is not found for the API developer, the MonetizationLimitsCheck policy raises a fault and blocks the API call.\n\n\nWhen you attach the MonetizationLimitsCheck policy to an API proxy, the\n`mint.limitscheck.*` and `mint.subscription_*` flow variables are populated,\nas described in\n[Debugging the MonetizationLimitsCheck policy](/apigee/docs/api-platform/monetization/debug-trace#monetizationlimitscheck) and the [mint](/apigee/docs/api-platform/reference/variables-reference#mint) flow variable reference.\n| **Note** : To prevent specific transactions from getting billed, you can use the **transactionSuccess** monetization variable. For more information about using the **transactionSuccess** variable, see [Monetization variables](/apigee/docs/api-platform/reference/policies/data-capture-policy#mint-var).\n\n\nFor more information, see:\n\n- [Creating an API proxy](/apigee/docs/api-platform/develop/ui-create-proxy#apigee-ui)\n- [Editing an API proxy](/apigee/docs/api-platform/develop/ui-edit-proxy)\n- [Attaching a policy to a flow](/apigee/docs/api-platform/develop/attaching-and-configuring-policies-management-ui#attaching-a-policy-to-a-flow)\n- [Debugging the MonetizationLimitsCheck policy](/apigee/docs/api-platform/monetization/debug-trace#monetizationlimitscheck) using Debug\n- [MonetizationLimitsCheck policy](/apigee/docs/api-platform/reference/policies/monetization-limits-check-policy)\n\nEnforce monetization quotas in API proxies\n------------------------------------------\n\n| **Note:** If you add a quota after the API product has been in use, the quota calculation starts from the next monetized transaction.\n\n\nA quota defines the number of requests allowed for an API product over a given time period. To\nenforce quotas for monetization, it is recommended that you set the quota value when\n[creating an API product](/apigee/docs/api-platform/publish/create-api-products).\n\n\nDefining a quota value for an API product does not automatically enforce restrictions on the\nnumber of calls that can be made through the API product. You must also add Quota policies to the\nAPI proxies that are referenced by the API product to ensure the quota value defined at the\nAPI product-level is enforced.\n\n\nEdit the Quota policy to enable the\n[\\\u003cUseQuotaConfigInAPIProduct\\\u003e](/apigee/docs/api-platform/reference/policies/quota-policy#usequotaconfiginapiproduct)\nelement to use the quota configuration defined at the API product-level.\n\nFor example: \n\n```\n\u003cQuota continueOnError=\"false\" enabled=\"true\" name=\"impose-quota\"\u003e\n \u003cDisplayName\u003eImpose Quota\u003c/DisplayName\u003e\n \u003cUseQuotaConfigInAPIProduct stepName=\"verify-api-key\"\u003e\n \u003cDefaultConfig\u003e\n \u003cAllow\u003e10000\u003c/Allow\u003e\n \u003cInterval\u003e1\u003c/Interval\u003e\n \u003cTimeUnit\u003eweek\u003c/TimeUnit\u003e\n \u003c/DefaultConfig\u003e\n \u003c/UseQuotaConfigInAPIProduct\u003e\n \u003cDistributed\u003etrue\u003c/Distributed\u003e\n \u003cSynchronous\u003etrue\u003c/Synchronous\u003e\n \u003cStartTime\u003e2021-01-01 12:00:00\u003c/StartTime\u003e\n\u003c/Quota\u003e\n```\n| **Notes:**\n|\n| - You can define the default configuration `\u003cDefaultConfig\u003e` to use if the quota configuration is not defined in the API product, but the quota configuration defined at the API product-level takes precedence.\n| - When you add the `\u003cUseQuotaConfigInAPIProduct\u003e` element to the Quota policy, then Apigee ignores any `\u003cAllow\u003e`, `\u003cInterval\u003e`, and `\u003cTimeUnit\u003e` child elements of `\u003cQuota\u003e`.\n\n\nWhen you attach the Quota policy to an API proxy, the `ratelimit.*` flow variables are\npopulated, as described in\n[Debugging the Quota policy](/apigee/docs/api-platform/monetization/debug-trace#quota)\nand the Quota policy\n[flow variables](/apigee/docs/api-platform/reference/policies/quota-policy#variables)\nreference.\n\nFor more information, see:\n\n- [Editing an API proxy](/apigee/docs/api-platform/develop/ui-edit-proxy)\n- [Attaching a policy to a flow](/apigee/docs/api-platform/develop/attaching-and-configuring-policies-management-ui#attaching-a-policy-to-a-flow)\n- [Debugging the Quota policy](/apigee/docs/api-platform/monetization/debug-trace#quota) using Debug\n- [Quota policy](/apigee/docs/api-platform/reference/policies/quota-policy)"]]