Saltar al contenido principal

PaymentRule

Rule of the current account that is checked on each payment. When conditions match, action applies: for example, route the payment to a processor, hide a payment method at checkout, or decline the payment. Settings > Payments orchestration shows the rules. An account connected to a partner can also hold rules that the partner wrote (ruleOrigin is PARTNER). The account cannot change them. Enabled rules run in priority order, and rules of equal priority in creation order. Every matching rule applies. For routing, store and point of sale tags, 3DS challenge and MONEI Flex, only the first matching rule counts. hide, block_provider and trigger_fraud_check rules add up.

type PaymentRule {
id: ID!
accountId: ID!
ruleOrigin: String
name: String
priority: Int!
enabled: Boolean!
conditions: AWSJSON!
action: AWSJSON!
createdAt: AWSTimestamp!
updatedAt: AWSTimestamp
targetIssues: [RuleTargetIssue!]
}

Fields​

PaymentRule.id ● ID! non-null scalar​

Rule ID.

PaymentRule.accountId ● ID! non-null scalar​

Account that owns the rule.

PaymentRule.ruleOrigin ● String scalar​

Who wrote the rule: USER for the current account, or PARTNER for its partner. The current account cannot change a PARTNER rule. null on older rules that the current account wrote.

PaymentRule.name ● String scalar​

Name of the rule. null when it has none.

PaymentRule.priority ● Int! non-null scalar​

Evaluation order. Lower values run first. Rules of equal priority run in creation order.

PaymentRule.enabled ● Boolean! non-null scalar​

Whether the rule runs. Disabled rules are skipped.

PaymentRule.conditions ● AWSJSON! non-null scalar​

JsonLogic expression evaluated against the payment, as a JSON-encoded string. Its var paths come from paymentRuleFields. The rule matches when the result is truthy.

PaymentRule.action ● AWSJSON! non-null scalar​

Action applied when conditions match. Shape mirrors PaymentRuleActionInput; which fields are populated depends on action.type. A target is returned in paymentProcessorId: monei for MONEI, or the ID of a processor the merchant holds a contract with; it is null when that processor no longer exists. providerId holds the same value and is **deprecated**: use paymentProcessorId. Returned as a JSON-encoded string.

PaymentRule.createdAt ● AWSTimestamp! non-null scalar​

Creation time as a Unix timestamp. Newer rules hold milliseconds; older rules hold seconds. A value below 1000000000000 is in seconds.

PaymentRule.updatedAt ● AWSTimestamp scalar​

Time of the last change, as a Unix timestamp in the same unit as createdAt. A new rule sets it when it is created.

PaymentRule.targetIssues ● [RuleTargetIssue!] list object​

Targets of the rule that cannot take the payments the rule sends to them. Empty when every target can.

Returned By​

createPaymentRule mutation ● paymentRule query ● updatePaymentRule mutation

Member Of​

PaymentRulesConnection object