> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gr4vy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get rule

> Returns a configured rule that triggers an action in a flow.

This endpoint requires the `flows.read` scope.


## OpenAPI

````yaml /openapi.v1.json GET /flows/{flow}/actions/{action}/rules/{rule_id}
openapi: 3.0.0
info:
  title: Gr4vy API
  version: 1.1.0-beta
  contact:
    name: Gr4vy Support
    email: code@gr4vy.com
    url: https://gr4vy.com
  termsOfService: https://gr4vy.com
  license:
    name: MIT
    url: https://raw.githubusercontent.com/gr4vy/gr4vy-openapi/main/LICENSE
  description: |-
    Welcome to the Gr4vy API reference documentation.
    Our API is still very much a work in product and subject to change.
servers:
  - url: https://api.sandbox.{id}.gr4vy.app
    x-speakeasy-server-id: sandbox
    variables:
      id:
        default: example
        description: The subdomain for your Gr4vy instance.
  - url: https://api.{id}.gr4vy.app
    x-speakeasy-server-id: production
    variables:
      id:
        default: example
        description: The subdomain for your Gr4vy instance.
security:
  - bearerAuth: []
tags:
  - name: Account Updater
    description: >-
      An Account Updater is a service provided by credit card issuers

      (such as banks and financial institutions) to merchants who accept

      recurring payments from customers. Its primary purpose is to help

      merchants maintain accurate and up-to-date payment information for

      their customers' credit or debit card accounts.


      In Gr4vy, the Account Updater service is provided in an on-demand

      and asynchronous fashion:


      1. A merchant requests an update for a set of stored cards.

      2. A request is submitted to a third-party service.

      3. When results are ready, new card details are stored and left in
      standby.

      4. Card details are updated when it gets determined that the original card
         is no longer valid (e.g. has expired).
  - name: Anti-Fraud Services
    description: >-
      In Gr4vy, an anti-fraud service represents a configured anti-fraud service

      provider (`Sift`, `CyberSource`, etc). This third-party services will be

      used to screen transactions to determine the risk and prevents chargebacks

      and fraudulent transactions.


      The anti-fraud services API can be used to:


      * Provide Gr4vy with the API credentials for an anti-fraud service
      provider.

      * Set a display name for a anti-fraud provider.

      * Map anti-fraud service decisions to Gr4vy internal decisions.
    x-internal: true
  - name: Anti Fraud Service Definitions
    description: >-
      Anti fraud service definitions describe the fields required for a anti
      fraud

      service to be configured.
  - name: API Key Pairs
    description: >-
      In Gr4vy, an API key pair is used to sign and validate JSON Web Tokens
      (JWT).

      JWTs are used as a HTTP `bearer` token to authenticate to the API. For
      more

      information please visit our [in-depth
      authentication](/guides/authentication)

      guide.
    x-internal: true
  - name: API Logs
    description: >-
      API Logs provide an historic of 4XX and 5XX errors that happened in the
      API

      in the last 24 hours with a 250 result limit.
    x-internal: true
  - name: Apple Pay Certificates
    description: >-
      Apple Pay payment processing certificates are used by Apple to encrypt
      Apple

      Pay tokens. You must register and upload an Apple Pay payment processing

      certificate if you wish to use Apple Pay with Gr4vy's mobile SDKs.


      The Apple Pay certificates API can be used to:


      * Start a new Apple Pay certificate registration, providing you with a

      Certificate Signing Request (CSR).

      * Update the Apple Pay certificate record with the certificate received
      from

      Apple after creating a new payment processing certificate on your Apple

      Developer console and uploading a CSR.

      * List all Apple Pay certificates.
    x-internal: true
  - name: Audit Logs
    description: >-
      Audit Logs provide an historic record of changes made to your Gr4vy
      instance.
  - name: Buyers
    description: >-
      In Gr4vy, a buyer represents your customer, the shopper who's performing

      a checkout and making a purchase.


      A buyer can be used by you to:


      * Display a human readable name (`display_name`) for a buyer in the Gr4vy

      admin panel

      * Associate multiple stored payment methods with a single user

      * Initialize **Gr4vy Embed** with the buyer ID, automatically displaying
      the
        buyer's previously stored payment methods, allowing for faster checkout.
  - name: Card Details
    description: Endpoints to retrieve details of a card by utilising a BIN lookup table.
    x-internal: true
  - name: Card Scheme Definitions
    description: Card Scheme definitions provide display information to a card scheme.
  - name: Connections
    description: |-
      Endpoints to retrieve details of configured connections such as payment
      services, digital wallets, and anti-fraud services.
    x-internal: true
  - name: Connection Definitions
    description: |-
      Endpoints to retrieve details of various connections such as payment
      services, digital wallets, and anti-fraud services.
    x-internal: true
  - name: Checkout Sessions
    description: |-
      A Checkout Session represents the session of a user as they progress
      through an online checkout.
  - name: Digital Wallets
    description: |-
      In Gr4vy, a digital wallet represents a way for a buyer to pay using
      card details already stored on their device via a digital wallet service
      such as Apple Pay or Google Pay. The buyer will not have to fill in their
      card details on checkout.

      The digital wallets API can be used to:

      * Register with a digital wallet provider.
      * List digital wallets currently registered.
  - name: Gift Cards
    description: >-
      In Gr4vy, a gift card represents a stored value card that can be used to
      pay for

      a transaction.
  - name: Gift Card Services
    description: >-
      In Gr4vy, a gift card service represents a configured provider for
      processing

      gift cards.
  - name: Gift Card Service Definitions
    description: |-
      Gift card service definitions describe the fields required for a gift
      card service to be configured.
  - name: Health Dashboard
    description: Endpoints to retrieve the data used for the Health Dashboard.
    x-internal: true
  - name: Merchant Accounts
    description: |-
      In Gr4vy, a merchant account represents an individual merchant in an
      instance. Each instance has one or more merchant accounts, and each
      merchant account has its own connections, Flow rules, transactions, and
      more.
  - name: Metrics Explorer
    description: Endpoints to retrieve the data used for the Metrics Explorer.
    x-internal: true
  - name: Payment Methods
    description: |-
      In Gr4vy, a payment method represents a way in which a payment can be
      processed, for example a card, a PayPal account, or a bank account.

      The payment method API can be used to:

      * List all the available payment methods
      * Filter the available payment method for a buyer in a specific currency
      and country.
      * Store (also known as vault) a payment method for a buyer.
      * Fetch all previously stored payment methods for a buyer.
  - name: Payment Method Definitions
    description: >-
      Payment Method definitions provide display information to a payment
      method.
  - name: Payment Options
    description: |-
      In Gr4vy, a payment option represents a list of methods (card, PayPal,
      etc) that are available for a given locale.

      The payment options API can be used to:

      * Determine what types of payments can be processed in a specific locale.
      * Display a list options to a buyer to choose from.
  - name: Payment Service Definitions
    description: |-
      Payment service definitions describe the fields required for a payment
      service to be configured.
  - name: Payment Services
    description: |-
      In Gr4vy, a payment service represents a configured payment provider
      (Stripe, PayPal, Adyen, etc) for a specific payment type (card, bitcoin,
      etc)

      The payment services API can be used to:

      * Provide Gr4vy with the payment credentials for a payment provider.
      * Set a display name for a payment provider.
  - name: Payouts
    description: |-
      Payouts allow a merchant to send money from one of their own accounts to a
      third party.
  - name: Payment Links
    description: >-
      In Gr4vy, payment links allow a merchant to generate a link, send it to a

      customer via email, SMS, etc, and then have the customer pay without the
      need

      for the merchant hosting their own checkout.
  - name: Vault Forward Definitions
    description: >-
      Vault Forward definitions describe a third party service that has been
      vetted

      to receive requests containing PCI data.
  - name: Vault Forward Configurations
    description: |-
      A Vault Forward Configuration represents a third party service that is
      currently enabled to send requests containing PCI data.
  - name: Vault Forward
    description: |-
      Vault Forwarding is a way to perform requests where, provided a template,
      Gr4vy will evaluate it to inject PCI data and forward it to third party
      services that have been vetted to receive such data.
  - name: Reports
    description: |-
      In Gr4vy, a report represents the configuration details to extract or
      dump a set of data into a downloadable CSV file. The data extracted
      by a report is configured via the reports API where you can specify:

      * Which fields should be in the dataset.
      * How the dataset should be sorted.
      * How the dataset should be filtered.

      Once a report is created, it may be executed on a one-off or recurring
      basis. One-off reports are executed only once shortly after the report
      is created, while recurring reports are executed periodically based on
      its configured frequency, e.g. weekly or monthly.

      During a report execution, the data is extracted and loaded into
      a CSV file according to the report's configuration. The resulting file
      may then be downloaded.

      The reports API can be used to:

      * Create and configure new reports.
      * List all reports.
      * View the configuration details of a report.
      * List a report's executions.
      * Reconfigure an existing report.
      * Generate a temporary URL to download the result of a report execution
      in CSV format.
  - name: Sessions
    description: |-
      The sessions APIs are used to facilitate user authentication for the Gr4vy
      dashboard.
    x-internal: true
  - name: Transactions
    description: >-
      In Gr4vy, a transaction represents a payment in any state, either before
      it

      is authorized, once it is captured, or after it has been refunded.


      The transactions API can be used to:


      - Authorize, capture, and store cards.

      - Authorize, capture, and store alternative payment methods like PayPal.

      - Refund, void, and otherwise cancel existing transactions.
  - name: Users
    description: |-
      In Gr4vy, a user represents an employee of the merchant with access to the
      dashboard.
    x-internal: true
  - name: Webhooks
    description: |-
      Endpoints related to webhooks to integrate Gr4vy with payment services
      webhooks functionality.
    x-internal: true
  - name: Flow
    description: >-
      In Gr4vy, a rule can be created that triggers actions anywhere in the
      payment flow.
    x-internal: true
  - name: Roles
    description: >-
      In Gr4vy, users can be granted access to specific types of resources and
      permissions

      to perform certain actions by being assigned one or more roles.
  - name: Tokens
    description: Endpoints related to the Gr4vy tokenization service.
  - name: Webhook subscriptions
    description: >-
      Endpoints related to the management of subscriptions for endpoints to
      receive webhooks.
paths:
  /flows/{flow}/actions/{action}/rules/{rule_id}:
    parameters:
      - schema:
          type: string
          description: The name of the Flow.
          example: checkout
          enum:
            - checkout
            - card-transaction
            - non-card-transaction
            - redirect-transaction
        name: flow
        in: path
        required: true
        description: >-
          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.
      - schema:
          type: string
          description: |
            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.
          example: select-payment-options
          enum:
            - select-payment-options
            - decline-early
            - route-transaction
            - skip-3ds
        name: action
        in: path
        required: true
        description: The flow action.
      - schema:
          type: string
          format: uuid
          example: 8724fd24-5489-4a5d-90fd-0604df7d3b83
        name: rule_id
        in: path
        required: true
        description: The unique ID for a rule.
    get:
      tags:
        - Flow
      summary: Get rule
      description: Returns a configured rule that triggers an action in a flow.
      operationId: get-flow-rule
      responses:
        '200':
          description: Returns the flow rule.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlowRule'
        '401':
          description: Returns an error if no valid authentication was provided.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error401Unauthorized'
        '404':
          description: Returns an error if the resource can not be found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error404NotFound'
components:
  schemas:
    FlowRule:
      title: Flow rule
      type: object
      x-tags:
        - Flow
      x-internal: true
      properties:
        type:
          type: string
          description: The type of this resource. Is always `rule`.
          example: rule
          enum:
            - rule
        id:
          type: string
          example: fe26475d-ec3e-4884-9553-f7356683f7f9
          description: The unique Gr4vy ID for this rule.
          format: uuid
        merchant_account_id:
          type: string
          description: The unique ID for a merchant account.
          example: default
        description:
          type: string
          description: Description of the flow rule.
          example: example rule.
          nullable: true
          minLength: 1
          maxLength: 200
        flow:
          type: string
          description: The name of the Flow.
          example: checkout
          enum:
            - checkout
            - card-transaction
            - non-card-transaction
            - redirect-transaction
        action:
          type: string
          description: |
            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.
          example: select-payment-options
          enum:
            - select-payment-options
            - decline-early
            - route-transaction
            - skip-3ds
        conditions:
          type: array
          description: |-
            One or more conditions that apply for this rule. Each condition
            needs to match for this rule to go into effect.
          items:
            oneOf:
              - $ref: '#/components/schemas/FlowAmountCondition'
              - $ref: '#/components/schemas/FlowAmountRangeCondition'
              - $ref: '#/components/schemas/FlowAmountZeroCondition'
              - $ref: '#/components/schemas/FlowAntiFraudDecisionCondition'
              - $ref: '#/components/schemas/FlowBINRangeCondition'
              - $ref: '#/components/schemas/FlowBrowserLanguageCondition'
              - $ref: '#/components/schemas/FlowCardCountryCondition'
              - $ref: '#/components/schemas/FlowCardIssuerNameCondition'
              - $ref: '#/components/schemas/FlowCardProductNameCondition'
              - $ref: '#/components/schemas/FlowCardSchemeCondition'
              - $ref: '#/components/schemas/FlowCardSourceCondition'
              - $ref: '#/components/schemas/FlowCardTypeCondition'
              - $ref: '#/components/schemas/FlowCountryCondition'
              - $ref: '#/components/schemas/FlowCurrencyCondition'
              - $ref: '#/components/schemas/FlowIsSubsequentPaymentCondition'
              - $ref: '#/components/schemas/FlowMetadataCondition'
              - $ref: '#/components/schemas/FlowMetadataNumericCondition'
              - $ref: '#/components/schemas/FlowMerchantInitiatedCondition'
              - $ref: '#/components/schemas/FlowPaymentMethodCondition'
              - $ref: '#/components/schemas/FlowPaymentMethodsCondition'
              - $ref: '#/components/schemas/FlowPaymentSourceCondition'
              - $ref: '#/components/schemas/FlowProductCategoriesCondition'
              - $ref: '#/components/schemas/FlowProductTypesCondition'
              - $ref: '#/components/schemas/FlowSKUsCondition'
              - $ref: '#/components/schemas/FlowSplitRoutingCondition'
        outcome:
          oneOf:
            - $ref: '#/components/schemas/FlowRuleServiceOutcome'
            - $ref: '#/components/schemas/FlowRuleMethodOutcome'
            - $ref: '#/components/schemas/FlowRuleBooleanOutcome'
            - $ref: '#/components/schemas/FlowRuleUUIDsListOutcome'
            - $ref: '#/components/schemas/FlowRuleThreeDSecureOutcome'
        position:
          description: The position of the rule in the flow.
          type: number
          example: 2
        created_at:
          description: |-
            The date and time
            when this buyer was created in our system.
          example: '2013-07-16T19:23:00.000+00:00'
          format: date-time
          type: string
        updated_at:
          description: |-
            The date and time
            when this buyer was last updated in our system.
          example: '2013-07-16T19:23:00.000+00:00'
          format: date-time
          type: string
        error_code:
          type: string
          nullable: true
          description: >-
            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.
          example: flow_error_code
          minLength: 1
          maxLength: 255
          pattern: ^flow_[a-z_]+$
    Error401Unauthorized:
      title: Unauthorized Error
      type: object
      description: Unauthorized Error (HTTP 401).
      x-tags:
        - Errors
      properties:
        type:
          type: string
          description: '`error`.'
          enum:
            - error
          example: error
        code:
          type: string
          description: '`unauthorized`.'
          example: unauthorized
          enum:
            - unauthorized
        status:
          type: integer
          description: '`401`.'
          example: 401
          enum:
            - 401
        message:
          type: string
          description: No valid API authentication found.
          example: No valid API authentication found
          enum:
            - No valid API authentication found
        details:
          type: array
          description: >-
            A list of detail objects that further clarify the reason for the
            error.

            Not every error supports more detail.
          example: []
          items:
            $ref: '#/components/schemas/ErrorDetail'
    Error404NotFound:
      title: Not Found Error
      type: object
      description: Not Found Error (HTTP 404).
      x-tags:
        - Errors
      properties:
        type:
          type: string
          description: '`error`.'
          enum:
            - error
          example: error
        code:
          type: string
          description: The reason code for the error.
          example: not_found
          enum:
            - not_found
            - pending_creation
        status:
          type: integer
          description: '`404`.'
          example: 404
          enum:
            - 404
        message:
          type: string
          description: The human readable reason for the error.
          example: The resource could not be found
        details:
          type: array
          description: >-
            A list of detail objects that further clarify the reason for the
            error.

            Not every error supports more detail.
          example: []
          items:
            $ref: '#/components/schemas/ErrorDetail'
    FlowAmountCondition:
      title: Flow amount condition
      type: object
      description: Amount conditions with a name, operator, and value.
      x-tags:
        - Flow
      x-internal: true
      required:
        - name
        - operator
        - value
      properties:
        name:
          type: string
          description: The type of match made for this rule.
          example: amount
          enum:
            - amount
        operator:
          type: string
          description: The comparison to make on the currency code `value`.
          example: less_than
          enum:
            - less_than
            - greater_than
        value:
          type: object
          description: Amount value compare the transaction to.
          properties:
            currency:
              type: string
              example: USD
              description: Currency ISO codes to compare the transaction to.
            value:
              type: number
              example: 1
              minimum: 0
              nullable: false
              description: Amount value to compare transaction value to.
          example:
            Amount condition value:
              value:
                description: example amount value.
                currency: USD
                value: 100
    FlowAmountRangeCondition:
      title: Flow amount range condition
      type: object
      description: Amount range conditions with a name, operator, and value.
      x-tags:
        - Flow
      x-internal: true
      required:
        - name
        - operator
        - value
      properties:
        name:
          type: string
          description: The type of match made for this rule.
          example: amount
          enum:
            - amount
        operator:
          type: string
          description: The comparison to make on the currency code `value`.
          example: is_between
          enum:
            - is_between
        value:
          type: object
          description: Amount value compare the transaction to.
          properties:
            currency:
              type: string
              example: USD
              description: Currency ISO codes to compare the transaction to.
            min:
              type: number
              example: 1
              minimum: 0
              description: Minimum value to compare transaction value to.
            max:
              type: number
              example: 200
              minimum: 0
              description: Maximum value to compare transaction value to.
          example:
            Amount condition value:
              value:
                description: example amount value.
                currency: USD
                min: 1
                max: 200
    FlowAmountZeroCondition:
      title: Flow zero amount condition
      type: object
      description: Amount conditions matching a value of 0 in any currency.
      x-tags:
        - Flow
      x-internal: true
      required:
        - name
        - operator
        - value
      properties:
        name:
          type: string
          description: The type of match made for this rule.
          example: amount_zero
          enum:
            - amount_zero
        operator:
          type: string
          description: The comparison to make on the transaction `value`.
          example: equal_to
          enum:
            - equal_to
        value:
          type: number
          description: The value of the transaction must be 0.
          example: 0
    FlowAntiFraudDecisionCondition:
      title: Flow anti-fraud decision condition
      type: object
      description: Anti-fraud decision condition with a name, operator, and value.
      x-tags:
        - Flow
      x-internal: true
      required:
        - name
        - operator
        - value
      properties:
        name:
          type: string
          description: The type of match made for this rule.
          example: anti_fraud_decision
          enum:
            - anti_fraud_decision
        operator:
          type: string
          description: The comparison to make on the `value`.
          example: is_one_of
          enum:
            - is_one_of
            - is_not_one_of
        value:
          type: array
          description: A list of anti-fraud decisions to match.
          example:
            - exception
          items:
            type: string
            minLength: 1
            enum:
              - accept
              - error
              - reject
              - review
              - exception
              - skipped
    FlowBINRangeCondition:
      title: Flow BIN range condition
      type: object
      description: BIN range conditions with a name, operator, and value.
      x-tags:
        - Flow
      x-internal: true
      required:
        - name
        - operator
        - value
      properties:
        name:
          type: string
          description: The type of match made for this rule.
          example: card_bin
          enum:
            - card_bin
        operator:
          type: string
          description: The comparison to make on the `card_bin` `value`.
          example: is_one_of
          enum:
            - is_one_of
            - is_not_one_of
        value:
          type: array
          items:
            type: string
            minLength: 1
          description: |-
            BIN range to compare with the transaction. A card BIN is
            8 characters long at maximum.
          example:
            - 41410000-42429999
    FlowBrowserLanguageCondition:
      title: Flow browser language condition
      type: object
      description: Browser language conditions with a name, operator, and value.
      x-tags:
        - Flow
      x-internal: true
      required:
        - name
        - operator
        - value
      properties:
        name:
          type: string
          description: The type of match made for this rule.
          example: browser_language
          enum:
            - browser_language
        operator:
          type: string
          description: The comparison to make on the browser language `value`.
          example: is_one_of
          enum:
            - is_one_of
            - is_not_one_of
        value:
          type: array
          description: >-
            Browser language two-letter ISO 639-1 codes to compare the
            transaction to.
          example:
            - en
            - de
            - fr
          items:
            maxLength: 2
            minLength: 2
            type: string
    FlowCardCountryCondition:
      title: Flow card country condition
      type: object
      description: Card country condition with a name, operator, and value.
      x-tags:
        - Flow
      x-internal: true
      required:
        - name
        - operator
        - value
      properties:
        name:
          type: string
          description: The type of match made for this rule.
          example: card_country
          enum:
            - card_country
        operator:
          type: string
          description: The comparison to make on the `value`.
          example: is_one_of
          enum:
            - is_one_of
            - is_not_one_of
        value:
          type: array
          description: |-
            Countries to compare the card originating country to
            in `ISO-3166` 2 character format.
          example:
            - ES
            - GB
          items:
            maxLength: 2
            minLength: 2
            type: string
    FlowCardIssuerNameCondition:
      title: Flow card issuer name condition
      type: object
      description: Card issuer name condition with a name, operator, and value.
      x-tags:
        - Flow
      x-internal: true
      required:
        - name
        - operator
        - value
      properties:
        name:
          type: string
          description: The type of match made for this rule.
          example: card_issuer_name
          enum:
            - card_issuer_name
        operator:
          type: string
          description: The comparison to make on the `value`.
          example: like_one_of
          enum:
            - like_one_of
            - unlike_any_of
        value:
          type: array
          items:
            type: string
          description: >-
            Issuer name(s) to compare the card issuer name to.

            Values can be a part of the full card's issuer name.

            The comparison is case-insensitive.

            For example, `Hsbc Uk Bank Plc` and `Pt Bank Hsbc Indonesia` will
            match `HSBC`.
          example:
            - HSBC
            - Barclays
    FlowCardProductNameCondition:
      title: Flow card product name condition
      type: object
      description: Card product name condition with a name, operator, and value.
      x-tags:
        - Flow
      x-internal: true
      required:
        - name
        - operator
        - value
      properties:
        name:
          type: string
          description: The type of match made for this rule.
          example: card_product_name
          enum:
            - card_product_name
        operator:
          type: string
          description: The comparison to make on the `value`.
          example: like_one_of
          enum:
            - like_one_of
            - unlike_any_of
        value:
          type: array
          items:
            type: string
          description: >-
            Product name(s) to compare the card product name to.

            Values can be a part of the full card's product name.

            The comparison is case-insensitive.

            For example, `Platinum MasterCard` and `Visa Platinum` will match
            `platinum`.
          example:
            - Electron
            - MasterCard Black
    FlowCardSchemeCondition:
      title: Flow card scheme condition
      type: object
      description: Card scheme conditions with a name, operator, and value.
      x-tags:
        - Flow
      x-internal: true
      required:
        - name
        - operator
        - value
      properties:
        name:
          type: string
          description: The type of match made for this rule.
          example: card_scheme
          enum:
            - card_scheme
        operator:
          type: string
          description: The comparison to make on the `value`.
          example: is_one_of
          enum:
            - is_one_of
            - is_not_one_of
        value:
          type: array
          description: Card scheme(s) to compare the transaction to.
          example:
            - visa
            - mastercard
          items:
            type: string
            example: visa
            enum:
              - accel
              - amex
              - bancontact
              - carte-bancaire
              - cirrus
              - culiance
              - dankort
              - diners-club
              - discover
              - eftpos-australia
              - elo
              - hipercard
              - jcb
              - maestro
              - mastercard
              - mir
              - nyce
              - other
              - pulse
              - rupay
              - star
              - uatp
              - unionpay
              - visa
              - null
    FlowCardSourceCondition:
      title: Flow card source condition
      type: object
      description: Card source conditions with a name, operator, and value.
      x-tags:
        - Flow
      x-internal: true
      required:
        - name
        - operator
        - value
      properties:
        name:
          type: string
          description: The type of match made for this rule.
          example: card_source
          enum:
            - card_source
        operator:
          type: string
          description: The comparison to make on the `value`.
          example: is_one_of
          enum:
            - is_one_of
            - is_not_one_of
        value:
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 50
            description: Card sources to compare the transaction to.
            enum:
              - applepay
              - googlepay
              - network-token
              - raw
              - token
          example:
            - raw
            - applepay
    FlowCardTypeCondition:
      title: Flow card type condition
      type: object
      description: Card type condition with a name, operator, and value.
      x-tags:
        - Flow
      x-internal: true
      required:
        - name
        - operator
        - value
      properties:
        name:
          type: string
          description: The type of match made for this rule.
          example: card_type
          enum:
            - card_type
        operator:
          type: string
          description: The comparison to make on the `value`.
          example: is_one_of
          enum:
            - is_one_of
            - is_not_one_of
        value:
          type: array
          description: Card type to compare the transaction to.
          example:
            - credit
          items:
            type: string
            minLength: 1
            maxLength: 50
            enum:
              - credit
              - debit
              - prepaid
    FlowCountryCondition:
      title: Flow country condition
      type: object
      description: Country conditions with a name, operator, and value.
      x-tags:
        - Flow
      x-internal: true
      required:
        - name
        - operator
        - value
      properties:
        name:
          type: string
          description: The type of match made for this rule.
          example: country
          enum:
            - country
        operator:
          type: string
          description: The comparison to make on the country code `value`.
          example: is_one_of
          enum:
            - is_one_of
            - is_not_one_of
        value:
          type: array
          description: Country two-letter ISO codes to compare the transaction to.
          example:
            - US
            - DE
          items:
            maxLength: 2
            minLength: 2
            type: string
    FlowCurrencyCondition:
      title: Flow currency condition
      type: object
      description: Currency conditions with a name, operator, and value.
      x-tags:
        - Flow
      x-internal: true
      required:
        - name
        - operator
        - value
      properties:
        name:
          type: string
          description: The type of match made for this rule.
          example: currency
          enum:
            - currency
        operator:
          type: string
          description: The comparison to make on the currency code `value`.
          example: is_one_of
          enum:
            - is_one_of
            - is_not_one_of
        value:
          type: array
          items:
            type: string
            minLength: 1
          description: Currency ISO codes to compare the transaction to.
          example:
            - USD
            - EUR
            - GBP
    FlowIsSubsequentPaymentCondition:
      title: Flow is subsequent payment condition
      type: object
      description: >-
        `is_subsequent_payment` flag conditions with a name, operator, and
        value.
      x-tags:
        - Flow
      x-internal: true
      required:
        - name
        - operator
        - value
      properties:
        name:
          type: string
          description: The type of match made for this rule.
          example: is_subsequent_payment
          enum:
            - is_subsequent_payment
        operator:
          type: string
          description: The comparison to make on the `is_subsequent_payment` flag `value`.
          example: equal_to
          enum:
            - equal_to
        value:
          type: boolean
          description: '`is_subsequent_payment` flag value to compare the transaction to.'
          example: true
    FlowMetadataCondition:
      title: Flow metadata condition
      type: object
      description: Metadata conditions with a name, operator, and value.
      x-tags:
        - Flow
      x-internal: true
      required:
        - name
        - operator
        - value
      properties:
        name:
          type: string
          description: The type of match made for this rule.
          example: metadata
          enum:
            - metadata
        operator:
          type: string
          description: The comparison to make on the currency code `value`.
          example: includes
          enum:
            - includes
            - excludes
        value:
          type: object
          description: The metadata to compare the transaction to.
          properties:
            key:
              type: string
              minLength: 1
              maxLength: 255
              example: product
              description: Key to metadata value to compare transaction to.
            value:
              oneOf:
                - type: array
                  items:
                    type: string
                    minLength: 1
                    maxLength: 255
                  minLength: 1
                  maxLength: 128
                  example:
                    - value1
                    - value2
                  description: List of metadata values to compare transaction to.
                - type: string
                  minLength: 1
                  maxLength: 255
                  example: phone
                  description: Value of metadata to compare transaction to.
    FlowMetadataNumericCondition:
      title: Flow metadata numeric condition
      type: object
      description: Metadata conditions with a name, operator, and numeric value.
      x-tags:
        - Flow
      x-internal: true
      required:
        - name
        - operator
        - value
      properties:
        name:
          type: string
          description: The unique name of this condition.
          example: metadata_numeric
          enum:
            - metadata_numeric
        operator:
          type: string
          description: The numeric comparison to evaluate.
          example: less_than
          enum:
            - less_than
            - greater_than
            - equal_to
            - less_than_or_equal_to
            - greater_than_or_equal_to
        value:
          type: object
          description: The metadata object to evaluate rules against.
          properties:
            key:
              type: string
              minLength: 1
              maxLength: 255
              example: product
              description: The key of the metadata object you wish to compare.
            value:
              type: number
              example: 100
              description: The numeric value to compare against.
    FlowMerchantInitiatedCondition:
      title: Flow merchant initiated condition
      type: object
      description: '`merchant_initiated` flag conditions with a name, operator, and value.'
      x-tags:
        - Flow
      x-internal: true
      required:
        - name
        - operator
        - value
      properties:
        name:
          type: string
          description: The type of match made for this rule.
          example: merchant_initiated
          enum:
            - merchant_initiated
        operator:
          type: string
          description: The comparison to make on the `merchant_initiated` flag `value`.
          example: equal_to
          enum:
            - equal_to
        value:
          type: boolean
          description: '`merchant_initiated` flag value to compare the transaction to.'
          example: true
    FlowPaymentMethodCondition:
      title: Flow payment method condition
      type: object
      description: |-
        Payment method conditions with a name, operator, and value. This
        condition is only for use with the `route-transaction` action.
      x-tags:
        - Flow
      x-internal: true
      required:
        - name
        - operator
        - value
      properties:
        name:
          type: string
          description: The type of match made for this rule.
          example: payment_method
          enum:
            - payment_method
        operator:
          type: string
          description: The comparison to make on the `value`.
          example: equal_to
          enum:
            - equal_to
        value:
          description: The payment method to compare the transaction to.
          example: card
          type: string
          enum:
            - affirm
            - afterpay
            - alipay
            - alipayhk
            - applepay
            - bacs
            - bancontact
            - banked
            - becs
            - bitpay
            - boleto
            - boost
            - card
            - cashapp
            - chaseorbital
            - checkout-session
            - clearpay
            - click-to-pay
            - dana
            - dcb
            - dlocal
            - ebanx
            - efecty
            - eps
            - everydaypay
            - gcash
            - gem
            - gemds
            - gift-card
            - giropay
            - givingblock
            - gocardless
            - googlepay
            - googlepay_pan_only
            - gopay
            - grabpay
            - id
            - ideal
            - kakaopay
            - kcp
            - klarna
            - latitude
            - latitudeds
            - laybuy
            - linepay
            - linkaja
            - maybankqrpay
            - mercadopago
            - multibanco
            - multipago
            - netbanking
            - network-token
            - oney_3x
            - oney_4x
            - oney_6x
            - oney_10x
            - oney_12x
            - ovo
            - oxxo
            - payid
            - paymaya
            - paypal
            - paypalpaylater
            - payto
            - venmo
            - pix
            - pse
            - rabbitlinepay
            - razorpay
            - scalapay
            - sepa
            - shopeepay
            - singteldash
            - smartpay
            - sofort
            - spei
            - stripedd
            - thaiqr
            - touchngo
            - truemoney
            - trustly
            - trustlyeurope
            - upi
            - vipps
            - waave
            - webpay
            - wechat
            - zippay
    FlowPaymentMethodsCondition:
      title: Flow payment methods condition
      type: object
      description: |-
        Payment methods condition with a name, operator, and value. This
        condition is only for use with the `decline-early` action.
      x-tags:
        - Flow
      x-internal: true
      required:
        - name
        - operator
        - value
      properties:
        name:
          type: string
          description: The type of match made for this rule.
          example: payment_method
          enum:
            - payment_method
        operator:
          type: string
          description: The comparison to make on the `value`.
          example: is_one_of
          enum:
            - is_one_of
            - is_not_one_of
        value:
          type: array
          items:
            type: string
            example: card
            enum:
              - affirm
              - afterpay
              - alipay
              - alipayhk
              - applepay
              - bacs
              - bancontact
              - banked
              - becs
              - bitpay
              - boleto
              - boost
              - card
              - cashapp
              - chaseorbital
              - checkout-session
              - clearpay
              - click-to-pay
              - dana
              - dcb
              - dlocal
              - ebanx
              - efecty
              - eps
              - everydaypay
              - gcash
              - gem
              - gemds
              - gift-card
              - giropay
              - givingblock
              - gocardless
              - googlepay
              - googlepay_pan_only
              - gopay
              - grabpay
              - id
              - ideal
              - kakaopay
              - kcp
              - klarna
              - latitude
              - latitudeds
              - laybuy
              - linepay
              - linkaja
              - maybankqrpay
              - mercadopago
              - multibanco
              - multipago
              - netbanking
              - network-token
              - oney_3x
              - oney_4x
              - oney_6x
              - oney_10x
              - oney_12x
              - ovo
              - oxxo
              - payid
              - paymaya
              - paypal
              - paypalpaylater
              - payto
              - venmo
              - pix
              - pse
              - rabbitlinepay
              - razorpay
              - scalapay
              - sepa
              - shopeepay
              - singteldash
              - smartpay
              - sofort
              - spei
              - stripedd
              - thaiqr
              - touchngo
              - truemoney
              - trustly
              - trustlyeurope
              - upi
              - vipps
              - waave
              - webpay
              - wechat
              - zippay
          example:
            - paypal
            - shopeepay
          description: Payment method(s) to compare the transaction to.
    FlowPaymentSourceCondition:
      title: Flow payment source condition
      type: object
      description: Payment source conditions with a name, operator, and value.
      x-tags:
        - Flow
      x-internal: true
      required:
        - name
        - operator
        - value
      properties:
        name:
          type: string
          description: The type of match made for this rule.
          example: payment_source
          enum:
            - payment_source
        operator:
          type: string
          description: The comparison to make on the payment source `value`.
          example: is_one_of
          enum:
            - is_one_of
            - is_not_one_of
        value:
          type: array
          items:
            type: string
            example: recurring
            enum:
              - ecommerce
              - moto
              - recurring
              - installment
              - card_on_file
          example:
            - recurring
            - installment
          description: Payment sources to compare the transaction to.
    FlowProductCategoriesCondition:
      title: Flow product categories condition
      type: object
      description: >-
        Cart items' product categories conditions with a name, operator, and
        value.
      x-tags:
        - Flow
      x-internal: true
      required:
        - name
        - operator
        - value
      properties:
        name:
          type: string
          description: The type of match made for this rule.
          example: product_categories
          enum:
            - product_categories
        operator:
          type: string
          description: The comparison to make on the `value`.
          example: includes_all
          enum:
            - includes_all
            - includes_at_least_one
            - includes_none
        value:
          type: array
          items:
            type: string
            minLength: 1
          description: Cart items' product categories to compare the transaction to.
          example:
            - electronics
            - printers
    FlowProductTypesCondition:
      title: Flow product types condition
      type: object
      description: Cart items' product types conditions with a name, operator, and value.
      x-tags:
        - Flow
      x-internal: true
      required:
        - name
        - operator
        - value
      properties:
        name:
          type: string
          description: The type of match made for this rule.
          example: product_types
          enum:
            - product_types
        operator:
          type: string
          description: The comparison to make on the `value`.
          example: includes_all
          enum:
            - includes_all
            - includes_at_least_one
            - includes_none
        value:
          type: array
          items:
            type: string
            example: physical
            enum:
              - physical
              - discount
              - shipping_fee
              - sales_tax
              - digital
              - gift_card
              - store_credit
              - surcharge
              - null
          example:
            - shipping_fee
            - sales_tax
          description: Cart items' product types to compare the transaction to.
    FlowSKUsCondition:
      title: Flow SKUs condition
      type: object
      description: Cart items' SKUs conditions with a name, operator, and value.
      x-tags:
        - Flow
      x-internal: true
      required:
        - name
        - operator
        - value
      properties:
        name:
          type: string
          description: The type of match made for this rule.
          example: skus
          enum:
            - skus
        operator:
          type: string
          description: The comparison to make on the `value`.
          example: includes_all
          enum:
            - includes_all
            - includes_at_least_one
            - includes_none
        value:
          type: array
          items:
            type: string
            minLength: 1
          description: Cart items' SKU values to compare the transaction to.
          example:
            - YZ1234
            - AB2345
            - TU4567
    FlowSplitRoutingCondition:
      title: Flow split routing condition
      type: object
      description: Split routing condition with a name, operator, and numeric value.
      x-tags:
        - Flow
      x-internal: true
      required:
        - name
        - operator
        - value
      properties:
        name:
          type: string
          description: The unique name of this condition.
          example: split_routing
          enum:
            - split_routing
        operator:
          type: string
          description: The numeric comparison to evaluate.
          example: less_than_or_equal_to
          enum:
            - less_than_or_equal_to
        value:
          type: integer
          description: The probability percentage of this condition to be triggered.
          minimum: 1
          maximum: 99
          example: 50
    FlowRuleServiceOutcome:
      title: Payment service outcome
      type: object
      description: |-
        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.
      x-tags:
        - Flow
      required:
        - type
        - result
        - version
      x-internal: true
      properties:
        type:
          type: string
          description: The type of action outcome for the given rule.
          example: card-routing
          enum:
            - card-routing
        result:
          type: array
          description: Results for a given flow action.
          items:
            type: object
            properties:
              payment_service_id:
                type: string
                description: >-
                  ID of the payment service to be used when processing the
                  transaction.
                nullable: false
                example: fe26475d-ec3e-4884-9553-f7356683f7f9
                format: uuid
              instrument:
                type: string
                description: >
                  The name of the instrument to be used to process the
                  transaction.

                  For `pan`, if a Payment Service token is available, the API
                  will use that

                  for stored payment methods.
                enum:
                  - network_token
                  - pan
                example: network_token
              transformations:
                type: array
                description: >-
                  List of transformations to apply when processing the
                  transaction.
                nullable: false
                items:
                  type: object
                  properties:
                    name:
                      type: string
                      description: Name of the transformation.
                      example: force_mit
                      enum:
                        - force_mit
                        - use_additional_scheme
          example:
            - 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:
          type: integer
          description: Version of the rule outcome. Current version is `2`.
          example: 2
          enum:
            - 2
    FlowRuleMethodOutcome:
      title: Payment method outcome
      type: object
      description: |-
        Defines the outcome of a rule in a flow where the result
        is a list of payment types.
      x-tags:
        - Flow
      required:
        - type
        - result
      x-internal: true
      properties:
        type:
          type: string
          description: The type of action outcome for the given rule.
          example: list
          enum:
            - list
        result:
          type: array
          description: Results for a given flow action.
          items:
            type: string
            example: card
            enum:
              - affirm
              - afterpay
              - alipay
              - alipayhk
              - applepay
              - bacs
              - bancontact
              - banked
              - becs
              - bitpay
              - boleto
              - boost
              - card
              - cashapp
              - chaseorbital
              - checkout-session
              - clearpay
              - click-to-pay
              - dana
              - dcb
              - dlocal
              - ebanx
              - efecty
              - eps
              - everydaypay
              - gcash
              - gem
              - gemds
              - gift-card
              - giropay
              - givingblock
              - gocardless
              - googlepay
              - googlepay_pan_only
              - gopay
              - grabpay
              - id
              - ideal
              - kakaopay
              - kcp
              - klarna
              - latitude
              - latitudeds
              - laybuy
              - linepay
              - linkaja
              - maybankqrpay
              - mercadopago
              - multibanco
              - multipago
              - netbanking
              - network-token
              - oney_3x
              - oney_4x
              - oney_6x
              - oney_10x
              - oney_12x
              - ovo
              - oxxo
              - payid
              - paymaya
              - paypal
              - paypalpaylater
              - payto
              - venmo
              - pix
              - pse
              - rabbitlinepay
              - razorpay
              - scalapay
              - sepa
              - shopeepay
              - singteldash
              - smartpay
              - sofort
              - spei
              - stripedd
              - thaiqr
              - touchngo
              - truemoney
              - trustly
              - trustlyeurope
              - upi
              - vipps
              - waave
              - webpay
              - wechat
              - zippay
          example:
            - card
            - paypal
    FlowRuleBooleanOutcome:
      title: Boolean outcome
      type: object
      description: |-
        Defines the outcome of a rule in a flow where the result
        is a boolean.
      x-tags:
        - Flow
      required:
        - type
        - result
      x-internal: true
      properties:
        type:
          type: string
          description: The type of action outcome for the given rule.
          example: boolean
          enum:
            - boolean
        result:
          type: boolean
          description: Results for a given flow action.
          enum:
            - true
    FlowRuleUUIDsListOutcome:
      title: UUIDs list outcome
      type: object
      description: |-
        Defines the outcome of a rule in a flow where the result
        is a list of UUIDs.

        Depending on the flow and action where this outcome is used, the UUIDs
        may have an important meaning like the ID of a payment service to be
        used (this is the case for `redirect-transaction` flow and
        `route-transaction` action).
      x-tags:
        - Flow
      required:
        - type
        - result
      x-internal: true
      properties:
        type:
          type: string
          description: The type of action outcome for the given rule.
          example: list
          enum:
            - list
        result:
          type: array
          description: Results for a given flow action.
          items:
            type: string
            example: fe26475d-ec3e-4884-9553-f7356683f7f9
            format: uuid
          example:
            - fe26475d-ec3e-4884-9553-f7356683f7f9
            - d88aca32-07fb-46cd-a43f-86da02b73c21
    FlowRuleThreeDSecureOutcome:
      title: 3DS outcome
      type: object
      description: Defines the outcome of a rule in a flow for 3DS.
      x-tags:
        - Flow
      required:
        - type
        - result
      x-internal: true
      properties:
        type:
          type: string
          description: The type of action outcome for the given rule.
          example: three-d-secure
          enum:
            - three-d-secure
        result:
          type: string
          description: Result for a given flow action.
          example: attempt
          enum:
            - attempt
            - force
            - skip
    ErrorDetail:
      title: Error details
      description: Additional detail about the part of a request body that caused an issue.
      type: object
      x-tags:
        - Errors
      properties:
        location:
          type: string
          example: body
          description: The location where the error caused an issue.
          enum:
            - query
            - body
            - path
            - header
        type:
          type: string
          example: value_error.missing
          description: A unique identifier for the type of error that occurred.
        pointer:
          type: string
          example: /payment_method/number
          description: >-
            The exact item for which the validation did not succeed. This is a
            JSON

            pointer for request bodies, while for query, path, and header
            parameters

            it is the name of the parameter.
        message:
          type: string
          example: field required
          description: A human readable message for this error detail.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````