Skip to main content
PUT
Update flow rule
This endpoint requires the flows.write scope.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

flow
enum<string>
required

The flow name. This can be one of the following.

  • checkout - Applies during checkout to determine what payment options are shown.
  • card-transaction - Applies when processing a card transaction.
  • non-card-transaction - Applies when processing a gift card only transaction, or a redirect transaction using the decline-early action.
  • redirect-transaction - Applies when processing any other transaction. The name of the Flow.
Available options:
checkout,
card-transaction,
non-card-transaction,
redirect-transaction
Example:

"checkout"

action
enum<string>
required

The flow action. Action for the given rule. Actions can only be used in flows that support them.

  • The checkout flow only supports the select-payment-options action.
  • The card-transaction supports the route-transaction, skip-3ds, and decline-early actions.
  • The non-card-transaction flow only supports the decline-early action.
  • The redirect-transaction flow only supports the route-transaction action.
Available options:
select-payment-options,
decline-early,
route-transaction,
skip-3ds
Example:

"select-payment-options"

rule_id
string<uuid>
required

The unique ID for a rule.

Example:

"8724fd24-5489-4a5d-90fd-0604df7d3b83"

Body

application/json

A request to update a rule.

position
number
required

The position of the rule in the flow.

Example:

2

description
string

Description of the flow rule.

Required string length: 1 - 200
Example:

"example rule."

conditions
(Flow amount condition · object | Flow amount range condition · object | Flow zero amount condition · object | Flow anti-fraud decision condition · object | Flow BIN range condition · object | Flow browser language condition · object | Flow card country condition · object | Flow card issuer name condition · object | Flow card product name condition · object | Flow card scheme condition · object | Flow card source condition · object | Flow card type condition · object | Flow country condition · object | Flow currency condition · object | Flow gift card BIN range condition · object | Flow has gift cards condition · object | Flow is subsequent payment condition · object | Flow metadata condition · object | Flow metadata numeric condition · object | Flow merchant initiated condition · object | Flow payment method condition · object | Flow payment methods condition · object | Flow payment source condition · object | Flow product categories condition · object | Flow product types condition · object | Flow SKUs condition · object | Flow split routing condition · object)[]

One or more conditions that apply for this rule. Each condition needs to match for this rule to go into effect.

Amount conditions with a name, operator, and value.

outcome
Boolean outcome · object

Defines the outcome of a rule in a flow where the result is a boolean.

error_code
string | null

A custom error code returned when this rule is triggered. This only applies to "decline-early" rule actions. The value must have a flow_ prefix.

Required string length: 1 - 255
Pattern: ^flow_[a-z_]+$
Example:

"flow_error_code"

Response

Returns the updated rule record.

type
enum<string>

The type of this resource. Is always rule.

Available options:
rule
Example:

"rule"

id
string<uuid>

The unique Gr4vy ID for this rule.

Example:

"fe26475d-ec3e-4884-9553-f7356683f7f9"

merchant_account_id
string

The unique ID for a merchant account.

Example:

"default"

description
string | null

Description of the flow rule.

Required string length: 1 - 200
Example:

"example rule."

flow
enum<string>

The name of the Flow.

Available options:
checkout,
card-transaction,
non-card-transaction,
redirect-transaction
Example:

"checkout"

action
enum<string>

Action for the given rule. Actions can only be used in flows that support them.

  • The checkout flow only supports the select-payment-options action.
  • The card-transaction supports the route-transaction, skip-3ds, and decline-early actions.
  • The non-card-transaction flow only supports the decline-early action.
  • The redirect-transaction flow only supports the route-transaction action.
Available options:
select-payment-options,
decline-early,
route-transaction,
skip-3ds
Example:

"select-payment-options"

conditions
(Flow amount condition · object | Flow amount range condition · object | Flow zero amount condition · object | Flow anti-fraud decision condition · object | Flow BIN range condition · object | Flow browser language condition · object | Flow card country condition · object | Flow card issuer name condition · object | Flow card product name condition · object | Flow card scheme condition · object | Flow card source condition · object | Flow card type condition · object | Flow country condition · object | Flow currency condition · object | Flow is subsequent payment condition · object | Flow metadata condition · object | Flow metadata numeric condition · object | Flow merchant initiated condition · object | Flow payment method condition · object | Flow payment methods condition · object | Flow payment source condition · object | Flow product categories condition · object | Flow product types condition · object | Flow SKUs condition · object | Flow split routing condition · object)[]

One or more conditions that apply for this rule. Each condition needs to match for this rule to go into effect.

Amount conditions with a name, operator, and value.

outcome
Payment service outcome · object

Defines the outcome of a rule in a flow where the result is a list of dictionaries that define the payment service, instrument and transformation to be used to process a transaction.

position
number

The position of the rule in the flow.

Example:

2

created_at
string<date-time>

The date and time when this buyer was created in our system.

Example:

"2013-07-16T19:23:00.000+00:00"

updated_at
string<date-time>

The date and time when this buyer was last updated in our system.

Example:

"2013-07-16T19:23:00.000+00:00"

error_code
string | null

A custom error code returned when this rule is triggered. This only applies to "decline-early" rule actions. The value must have a flow_ prefix.

Required string length: 1 - 255
Pattern: ^flow_[a-z_]+$
Example:

"flow_error_code"