Skip to content
Start here

Monetization

ModelsExpand Collapse
type MonetizationAccountEligibilityCheckInput struct{…}
AcceptedTermsOfService MonetizationAccountEligibilityCheckInputAcceptedTermsOfService

Confirms acceptance of the Monetization Gateway terms of service.

type MonetizationAccountEligibilityCheckResponse struct{…}
Errors []MonetizationAccountEligibilityCheckResponseError
Code int64Optional
Message stringOptional
Messages []MonetizationAccountEligibilityCheckResponseMessage
Code int64Optional
Message stringOptional
Success MonetizationAccountEligibilityCheckResponseSuccess
type MonetizationEligibilityResponse struct{…}
Errors []MonetizationEligibilityResponseError
Code int64Optional
Message stringOptional
Messages []MonetizationEligibilityResponseMessage
Code int64Optional
Message stringOptional
Success MonetizationEligibilityResponseSuccess
type MonetizationEligibilityResult struct{…}
Status MonetizationEligibilityResultStatus

Current monetization eligibility decision.

One of the following:
const MonetizationEligibilityResultStatusPending MonetizationEligibilityResultStatus = "pending"
const MonetizationEligibilityResultStatusApproved MonetizationEligibilityResultStatus = "approved"
const MonetizationEligibilityResultStatusRejected MonetizationEligibilityResultStatus = "rejected"
Reasons []stringOptional

Public, human-readable reasons for a rejected decision, when available.

type MonetizationZoneEligibilityCheckResponse struct{…}
Errors []MonetizationZoneEligibilityCheckResponseError
Code int64Optional
Message stringOptional
Messages []MonetizationZoneEligibilityCheckResponseMessage
Code int64Optional
Message stringOptional
Result MonetizationZoneEligibilityCheckResponseResult
Enabled bool

Whether this check successfully enabled the zone entitlement. Only approved decisions can enable it.

Status MonetizationZoneEligibilityCheckResponseResultStatus

Current monetization eligibility decision.

One of the following:
const MonetizationZoneEligibilityCheckResponseResultStatusPending MonetizationZoneEligibilityCheckResponseResultStatus = "pending"
const MonetizationZoneEligibilityCheckResponseResultStatusApproved MonetizationZoneEligibilityCheckResponseResultStatus = "approved"
const MonetizationZoneEligibilityCheckResponseResultStatusRejected MonetizationZoneEligibilityCheckResponseResultStatus = "rejected"
Reasons []stringOptional

Public, human-readable reasons for a rejected decision, when available.

Success MonetizationZoneEligibilityCheckResponseSuccess

MonetizationRules

List payment rules
client.Monetization.Rules.Get(ctx, query) (*MonetizationRuleCollection, error)
GET/zones/{zone_id}/monetization/rules
Deploy payment ruleset
client.Monetization.Rules.Update(ctx, params) (*MonetizationRuleCollection, error)
PUT/zones/{zone_id}/monetization/rules
Delete all payment rules
client.Monetization.Rules.Delete(ctx, body) (*MonetizationRuleCollection, error)
DELETE/zones/{zone_id}/monetization/rules
Get a payment rule
client.Monetization.Rules.GetRule(ctx, ruleID, query) (*MonetizationRule, error)
GET/zones/{zone_id}/monetization/rules/{rule_id}
Update a payment rule
client.Monetization.Rules.EditRule(ctx, ruleID, params) (*MonetizationRuleCollection, error)
PATCH/zones/{zone_id}/monetization/rules/{rule_id}
Delete a payment rule
client.Monetization.Rules.DeleteRule(ctx, ruleID, body) (*MonetizationRuleCollection, error)
DELETE/zones/{zone_id}/monetization/rules/{rule_id}
ModelsExpand Collapse
type MonetizationRule interface{…}

Payment rule with a fixed price set at configuration time.

One of the following:
type MonetizationRuleMonetizationRulesMonetizationRuleInputFixedPrice struct{…}

Payment rule with a fixed price set at configuration time.

ID string

The server-assigned unique ID of the payment rule. Stable across full-ruleset replacements.

maxLength32
type MonetizationRuleMonetizationRulesMonetizationRuleInputOriginControlled struct{…}

Payment rule whose price the origin server sets dynamically. The rule carries no price and the price field must be omitted — any provided value, including “0”, is rejected because it would not be enforced.

ID string

The server-assigned unique ID of the payment rule. Stable across full-ruleset replacements.

maxLength32
type MonetizationRuleCollection struct{…}

The zone’s payment rules. Mirrors the shape of the ruleset submitted to the deploy endpoint, so the response can be read back as the desired state.

The zone’s payment rules, in the order they are evaluated. Empty when the zone has no payment rules.

One of the following:
type MonetizationRuleMonetizationRulesMonetizationRuleInputFixedPrice struct{…}

Payment rule with a fixed price set at configuration time.

ID string

The server-assigned unique ID of the payment rule. Stable across full-ruleset replacements.

maxLength32
type MonetizationRuleMonetizationRulesMonetizationRuleInputOriginControlled struct{…}

Payment rule whose price the origin server sets dynamically. The rule carries no price and the price field must be omitted — any provided value, including “0”, is rejected because it would not be enforced.

ID string

The server-assigned unique ID of the payment rule. Stable across full-ruleset replacements.

maxLength32
type MonetizationRuleInput interface{…}

Payment rule with a fixed price set at configuration time.

One of the following:
type MonetizationRuleInputFixedPrice struct{…}

Payment rule with a fixed price set at configuration time.

Address string

0x-prefixed 20-byte hexadecimal Ethereum address. Mixed-case addresses must carry a valid EIP-55 checksum; all-lowercase or all-uppercase addresses are also accepted. The address must pass wallet screening whenever its rule is deployed or patched.

Expression string

Wirefilter expression identifying the requests that require payment. Forwarded verbatim to the Rulesets API, which validates its syntax.

Price string

Price in the smallest indivisible unit of the configured payment token, encoded as a decimal string. Must be a canonical decimal integer in [1000, 100000000]: no leading zeros, and a bare JSON number is rejected. The price is required for the fixed-price schemes (“exact” and “upto”) and must be at least 1000, the smallest amount the payment facilitator can settle ($0.001 for a 6-decimal token such as USDC), and at most 100000000 ($100 for a 6-decimal token). When the scheme is “origin_controlled” the origin server sets pricing dynamically and the rule carries no price: the field must be omitted — any provided value, including “0”, is rejected because it would not be enforced. Responses always encode this as a string and omit it for “origin_controlled” rules; the pattern matches exactly the set of values the server accepts.

Scheme MonetizationRuleInputFixedPriceScheme

X402 payment scheme. “exact” requires the specified payment amount; “upto” permits a payment up to the specified amount. Both fixed-price schemes require the price field.

One of the following:
const MonetizationRuleInputFixedPriceSchemeExact MonetizationRuleInputFixedPriceScheme = "exact"
const MonetizationRuleInputFixedPriceSchemeUpto MonetizationRuleInputFixedPriceScheme = "upto"
ID stringOptional

Optional on input. Include the ID of an existing payment rule to update it in place, preserving its stable identity across the full-ruleset replacement; omit it to create a new rule. An ID that does not match an existing payment rule in the zone is rejected. Rules omitted from the request are deleted.

maxLength32
Description stringOptional
maxLength512
Enabled boolOptional
type MonetizationRuleInputOriginControlled struct{…}

Payment rule whose price the origin server sets dynamically. The rule carries no price and the price field must be omitted — any provided value, including “0”, is rejected because it would not be enforced.

Address string

0x-prefixed 20-byte hexadecimal Ethereum address. Mixed-case addresses must carry a valid EIP-55 checksum; all-lowercase or all-uppercase addresses are also accepted. The address must pass wallet screening whenever its rule is deployed or patched.

Expression string

Wirefilter expression identifying the requests that require payment. Forwarded verbatim to the Rulesets API, which validates its syntax.

Scheme MonetizationRuleInputOriginControlledScheme

X402 payment scheme. “origin_controlled” lets the origin server set pricing dynamically; the rule carries no price and the price field must be omitted.

ID stringOptional

Optional on input. Include the ID of an existing payment rule to update it in place, preserving its stable identity across the full-ruleset replacement; omit it to create a new rule. An ID that does not match an existing payment rule in the zone is rejected. Rules omitted from the request are deleted.

maxLength32
Description stringOptional
maxLength512
Enabled boolOptional
type MonetizationRuleInputFixedPrice struct{…}

Payment rule with a fixed price set at configuration time.

Address string

0x-prefixed 20-byte hexadecimal Ethereum address. Mixed-case addresses must carry a valid EIP-55 checksum; all-lowercase or all-uppercase addresses are also accepted. The address must pass wallet screening whenever its rule is deployed or patched.

Expression string

Wirefilter expression identifying the requests that require payment. Forwarded verbatim to the Rulesets API, which validates its syntax.

Price string

Price in the smallest indivisible unit of the configured payment token, encoded as a decimal string. Must be a canonical decimal integer in [1000, 100000000]: no leading zeros, and a bare JSON number is rejected. The price is required for the fixed-price schemes (“exact” and “upto”) and must be at least 1000, the smallest amount the payment facilitator can settle ($0.001 for a 6-decimal token such as USDC), and at most 100000000 ($100 for a 6-decimal token). When the scheme is “origin_controlled” the origin server sets pricing dynamically and the rule carries no price: the field must be omitted — any provided value, including “0”, is rejected because it would not be enforced. Responses always encode this as a string and omit it for “origin_controlled” rules; the pattern matches exactly the set of values the server accepts.

Scheme MonetizationRuleInputFixedPriceScheme

X402 payment scheme. “exact” requires the specified payment amount; “upto” permits a payment up to the specified amount. Both fixed-price schemes require the price field.

One of the following:
const MonetizationRuleInputFixedPriceSchemeExact MonetizationRuleInputFixedPriceScheme = "exact"
const MonetizationRuleInputFixedPriceSchemeUpto MonetizationRuleInputFixedPriceScheme = "upto"
ID stringOptional

Optional on input. Include the ID of an existing payment rule to update it in place, preserving its stable identity across the full-ruleset replacement; omit it to create a new rule. An ID that does not match an existing payment rule in the zone is rejected. Rules omitted from the request are deleted.

maxLength32
Description stringOptional
maxLength512
Enabled boolOptional
type MonetizationRuleInputOriginControlled struct{…}

Payment rule whose price the origin server sets dynamically. The rule carries no price and the price field must be omitted — any provided value, including “0”, is rejected because it would not be enforced.

Address string

0x-prefixed 20-byte hexadecimal Ethereum address. Mixed-case addresses must carry a valid EIP-55 checksum; all-lowercase or all-uppercase addresses are also accepted. The address must pass wallet screening whenever its rule is deployed or patched.

Expression string

Wirefilter expression identifying the requests that require payment. Forwarded verbatim to the Rulesets API, which validates its syntax.

Scheme MonetizationRuleInputOriginControlledScheme

X402 payment scheme. “origin_controlled” lets the origin server set pricing dynamically; the rule carries no price and the price field must be omitted.

ID stringOptional

Optional on input. Include the ID of an existing payment rule to update it in place, preserving its stable identity across the full-ruleset replacement; omit it to create a new rule. An ID that does not match an existing payment rule in the zone is rejected. Rules omitted from the request are deleted.

maxLength32
Description stringOptional
maxLength512
Enabled boolOptional
type MonetizationRulePatch struct{…}

Partial update to a single payment rule. Only the fields present are modified; omitted fields keep their existing values.

Address stringOptional

0x-prefixed 20-byte hexadecimal Ethereum address. Mixed-case addresses must carry a valid EIP-55 checksum; all-lowercase or all-uppercase addresses are also accepted. The effective address must pass wallet screening whenever the rule is patched.

Description stringOptional
maxLength512
Enabled boolOptional
Expression stringOptional

Wirefilter expression identifying the requests that require payment. Forwarded verbatim to the Rulesets API, which validates its syntax.

Price stringOptional

Price in the smallest indivisible unit of the configured payment token, encoded as a decimal string. Must be a canonical decimal integer in [1000, 100000000]: no leading zeros, and a bare JSON number is rejected. The price is required for the fixed-price schemes (“exact” and “upto”) and must be at least 1000, the smallest amount the payment facilitator can settle ($0.001 for a 6-decimal token such as USDC), and at most 100000000 ($100 for a 6-decimal token). When the scheme is “origin_controlled” the origin server sets pricing dynamically and the rule carries no price: the field must be omitted — any provided value, including “0”, is rejected because it would not be enforced. Responses always encode this as a string and omit it for “origin_controlled” rules; the pattern matches exactly the set of values the server accepts.

Scheme MonetizationRulePatchSchemeOptional

X402 payment scheme. “exact” requires the specified payment amount; “upto” permits a payment up to the specified amount; “origin_controlled” lets the origin server set pricing dynamically, in which case the rule carries no price and the price field must be omitted.

One of the following:
const MonetizationRulePatchSchemeExact MonetizationRulePatchScheme = "exact"
const MonetizationRulePatchSchemeUpto MonetizationRulePatchScheme = "upto"
const MonetizationRulePatchSchemeOriginControlled MonetizationRulePatchScheme = "origin_controlled"
type MonetizationRulesetInput struct{…}

Full desired Payment Required ruleset. An empty array clears all payment rules. The ruleset may contain at most 40 unique wallet addresses; address comparison is case-insensitive. Every address must pass wallet screening before deployment.

One of the following:
type MonetizationRuleInputFixedPrice struct{…}

Payment rule with a fixed price set at configuration time.

Address string

0x-prefixed 20-byte hexadecimal Ethereum address. Mixed-case addresses must carry a valid EIP-55 checksum; all-lowercase or all-uppercase addresses are also accepted. The address must pass wallet screening whenever its rule is deployed or patched.

Expression string

Wirefilter expression identifying the requests that require payment. Forwarded verbatim to the Rulesets API, which validates its syntax.

Price string

Price in the smallest indivisible unit of the configured payment token, encoded as a decimal string. Must be a canonical decimal integer in [1000, 100000000]: no leading zeros, and a bare JSON number is rejected. The price is required for the fixed-price schemes (“exact” and “upto”) and must be at least 1000, the smallest amount the payment facilitator can settle ($0.001 for a 6-decimal token such as USDC), and at most 100000000 ($100 for a 6-decimal token). When the scheme is “origin_controlled” the origin server sets pricing dynamically and the rule carries no price: the field must be omitted — any provided value, including “0”, is rejected because it would not be enforced. Responses always encode this as a string and omit it for “origin_controlled” rules; the pattern matches exactly the set of values the server accepts.

Scheme MonetizationRuleInputFixedPriceScheme

X402 payment scheme. “exact” requires the specified payment amount; “upto” permits a payment up to the specified amount. Both fixed-price schemes require the price field.

One of the following:
const MonetizationRuleInputFixedPriceSchemeExact MonetizationRuleInputFixedPriceScheme = "exact"
const MonetizationRuleInputFixedPriceSchemeUpto MonetizationRuleInputFixedPriceScheme = "upto"
ID stringOptional

Optional on input. Include the ID of an existing payment rule to update it in place, preserving its stable identity across the full-ruleset replacement; omit it to create a new rule. An ID that does not match an existing payment rule in the zone is rejected. Rules omitted from the request are deleted.

maxLength32
Description stringOptional
maxLength512
Enabled boolOptional
type MonetizationRuleInputOriginControlled struct{…}

Payment rule whose price the origin server sets dynamically. The rule carries no price and the price field must be omitted — any provided value, including “0”, is rejected because it would not be enforced.

Address string

0x-prefixed 20-byte hexadecimal Ethereum address. Mixed-case addresses must carry a valid EIP-55 checksum; all-lowercase or all-uppercase addresses are also accepted. The address must pass wallet screening whenever its rule is deployed or patched.

Expression string

Wirefilter expression identifying the requests that require payment. Forwarded verbatim to the Rulesets API, which validates its syntax.

Scheme MonetizationRuleInputOriginControlledScheme

X402 payment scheme. “origin_controlled” lets the origin server set pricing dynamically; the rule carries no price and the price field must be omitted.

ID stringOptional

Optional on input. Include the ID of an existing payment rule to update it in place, preserving its stable identity across the full-ruleset replacement; omit it to create a new rule. An ID that does not match an existing payment rule in the zone is rejected. Rules omitted from the request are deleted.

maxLength32
Description stringOptional
maxLength512
Enabled boolOptional