PUT
/
flows
/
{flow}
/
actions
/
{action}
/
rules
/
{rule_id}
curl --request PUT \
  --url https://api.{gr4vy_id}.gr4vy.app/flows/{flow}/actions/{action}/rules/{rule_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "description": "example description update.",
  "position": 1
}'
{
  "type": "rule",
  "id": "fe26475d-ec3e-4884-9553-f7356683f7f9",
  "merchant_account_id": "default",
  "description": "example rule.",
  "flow": "checkout",
  "action": "select-payment-options",
  "conditions": [
    {
      "name": "amount",
      "operator": "less_than",
      "value": {
        "Amount condition value": {
          "value": {
            "description": "example amount value.",
            "currency": "USD",
            "value": 100
          }
        }
      }
    }
  ],
  "outcome": {
    "type": "card-routing",
    "result": [
      {
        "payment_service_id": "fe26475d-ec3e-4884-9553-f7356683f7f9",
        "instrument\"": "network_token",
        "transformations": []
      },
      {
        "payment_service_id": "d88aca32-07fb-46cd-a43f-86da02b73c21",
        "instrument": "pan",
        "transformations": [
          {
            "name": "force_mit"
          }
        ]
      }
    ],
    "version": 2
  },
  "position": 2,
  "created_at": "2013-07-16T19:23:00.000+00:00",
  "updated_at": "2013-07-16T19:23:00.000+00:00",
  "error_code": "flow_error_code"
}

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.
Available options:
checkout,
card-transaction,
non-card-transaction,
redirect-transaction
action
enum<string>
required

The flow action.

Available options:
select-payment-options,
decline-early,
route-transaction,
skip-3ds
rule_id
string
required

The unique ID for a rule.

Body

application/json

A request to update a rule.

position
number
required

The position of the rule in the flow.

description
string

Description of the flow rule.

Required string length: 1 - 200
conditions
object[]

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

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

Response

200
application/json
Returns the updated rule record.
type
enum<string>

The type of this resource. Is always rule.

Available options:
rule
id
string

The unique Gr4vy ID for this rule.

merchant_account_id
string

The unique ID for a merchant account.

description
string | null

Description of the flow rule.

Required string length: 1 - 200
flow
enum<string>

The name of the Flow.

Available options:
checkout,
card-transaction,
non-card-transaction,
redirect-transaction
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
conditions
object[]

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

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.

created_at
string

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

updated_at
string

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

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