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

# Find plans

> Find plans using PayNext's Search Query Language. Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind.

## Search Query Language

Build a search query by combining one or more search clauses. A clause has the format `field operator value` where the operators are `:`, `~`, `>`, `<`, `>=`, `<=`, or the prefix `-` for negation.

### Operators

| Operator | Description | Example |
|---|---|---|
| `:` | Exact match (case-insensitive) | `type:"recurring"` |
| `~` | Substring match (min 3 chars, case-insensitive) | `name~"pro"` |
| `>` | Greater than | `price.default.amount>1000` |
| `>=` | Greater than or equal | `price.default.amount>=1000` |
| `<` | Less than | `price.default.amount<5000` |
| `<=` | Less than or equal | `interval_count<=12` |
| `-` | Negation (prefix) | `-type:"one-off"` |

### Logical Operators

Combine clauses with `AND` or `OR`. Clauses separated by a space default to `AND` logic. You cannot mix `AND` and `OR` in the same query. Maximum of 10 clauses per query.

### Quoting

String values must be enclosed in single or double quotes. Numeric values do not require quotes. Escape quotes with a backslash.

### Null Checks

Use `field:null` to find records where a field is empty or absent (e.g., to find active/non-archived plans: `archived_at:null`). Use `-field:null` to find records where a field is present.

### Nested Fields

Access nested object fields using dot notation. Examples:
- `price.default.currency:"USD"`
- `price.default.amount>=1999`
- `trial_price.default.amount:null`

### Searchable Plan Fields

| Field | Type | Operators |
|---|---|---|
| `id` | token | `:` |
| `name` | string | `:`, `~` |
| `type` | string (recurring/one-off) | `:` |
| `interval` | string (days/months/years) | `:` |
| `interval_count` | numeric | `:`, `>`, `>=`, `<`, `<=` |
| `trial_interval` | string (days/months/years) | `:` |
| `trial_interval_count` | numeric | `:`, `>`, `>=`, `<`, `<=` |
| `archived_at` | date (RFC3339, nullable) | `:`, `>`, `>=`, `<`, `<=` |
| `created_at` | date (RFC3339) | `:`, `>`, `>=`, `<`, `<=` |
| `updated_at` | date (RFC3339) | `:`, `>`, `>=`, `<`, `<=` |

**Nested price fields:**

| Field | Type | Operators |
|---|---|---|
| `price.default.currency` | string (ISO 4217) | `:` |
| `price.default.amount` | numeric (minor units) | `:`, `>`, `>=`, `<`, `<=` |
| `trial_price.default.currency` | string (ISO 4217) | `:` |
| `trial_price.default.amount` | numeric (minor units) | `:`, `>`, `>=`, `<`, `<=` |
| `tax.collect_tax` | string (DEFAULT/COLLECT/DONT_COLLECT) | `:` |



## OpenAPI

````yaml /api-reference/openapi3-v2.0.0.json get /plans
openapi: 3.0.1
info:
  contact: {}
  description: Billing API
  title: Billing v2.0.0
  version: '3.0'
servers:
  - url: https://sandbox-api.paynext.com/
security: []
paths:
  /plans:
    get:
      tags:
        - Plans
      summary: Find plans
      description: >-
        Find plans using PayNext's Search Query Language. Don't use search in
        read-after-write flows where strict consistency is necessary. Under
        normal operating conditions, data is searchable in less than a minute.
        Occasionally, propagation of new or updated data can be up to an hour
        behind.


        ## Search Query Language


        Build a search query by combining one or more search clauses. A clause
        has the format `field operator value` where the operators are `:`, `~`,
        `>`, `<`, `>=`, `<=`, or the prefix `-` for negation.


        ### Operators


        | Operator | Description | Example |

        |---|---|---|

        | `:` | Exact match (case-insensitive) | `type:"recurring"` |

        | `~` | Substring match (min 3 chars, case-insensitive) | `name~"pro"` |

        | `>` | Greater than | `price.default.amount>1000` |

        | `>=` | Greater than or equal | `price.default.amount>=1000` |

        | `<` | Less than | `price.default.amount<5000` |

        | `<=` | Less than or equal | `interval_count<=12` |

        | `-` | Negation (prefix) | `-type:"one-off"` |


        ### Logical Operators


        Combine clauses with `AND` or `OR`. Clauses separated by a space default
        to `AND` logic. You cannot mix `AND` and `OR` in the same query. Maximum
        of 10 clauses per query.


        ### Quoting


        String values must be enclosed in single or double quotes. Numeric
        values do not require quotes. Escape quotes with a backslash.


        ### Null Checks


        Use `field:null` to find records where a field is empty or absent (e.g.,
        to find active/non-archived plans: `archived_at:null`). Use
        `-field:null` to find records where a field is present.


        ### Nested Fields


        Access nested object fields using dot notation. Examples:

        - `price.default.currency:"USD"`

        - `price.default.amount>=1999`

        - `trial_price.default.amount:null`


        ### Searchable Plan Fields


        | Field | Type | Operators |

        |---|---|---|

        | `id` | token | `:` |

        | `name` | string | `:`, `~` |

        | `type` | string (recurring/one-off) | `:` |

        | `interval` | string (days/months/years) | `:` |

        | `interval_count` | numeric | `:`, `>`, `>=`, `<`, `<=` |

        | `trial_interval` | string (days/months/years) | `:` |

        | `trial_interval_count` | numeric | `:`, `>`, `>=`, `<`, `<=` |

        | `archived_at` | date (RFC3339, nullable) | `:`, `>`, `>=`, `<`, `<=` |

        | `created_at` | date (RFC3339) | `:`, `>`, `>=`, `<`, `<=` |

        | `updated_at` | date (RFC3339) | `:`, `>`, `>=`, `<`, `<=` |


        **Nested price fields:**


        | Field | Type | Operators |

        |---|---|---|

        | `price.default.currency` | string (ISO 4217) | `:` |

        | `price.default.amount` | numeric (minor units) | `:`, `>`, `>=`, `<`,
        `<=` |

        | `trial_price.default.currency` | string (ISO 4217) | `:` |

        | `trial_price.default.amount` | numeric (minor units) | `:`, `>`, `>=`,
        `<`, `<=` |

        | `tax.collect_tax` | string (DEFAULT/COLLECT/DONT_COLLECT) | `:` |
      operationId: findPlans
      parameters:
        - description: Specifies the version of the API to use
          in: header
          name: X-API-Version
          schema:
            enum:
              - 2.0.0
            type: string
            default: 2.0.0
          required: true
        - in: query
          name: query
          required: true
          schema:
            type: string
          description: >-
            The search query string. Uses PayNext's Search Query Language.
            Supports exact match (`:`), substring match (`~`), numeric
            comparisons (`>`, `>=`, `<`, `<=`), negation (`-`), logical
            operators (`AND`, `OR`), and nested field access (dot notation).
            Field names use dotted paths (for example `payment_status`,
            `customer.email`, `payment_method.details.last4`); short aliases are
            not accepted. See the endpoint description for the full list of
            searchable fields and their types. Use `archived_at:null` to find
            active plans. Maximum 10 clauses per query.
          example: type:"recurring" AND archived_at:null
        - in: query
          name: limit
          schema:
            type: integer
            default: 10
            minimum: 1
            maximum: 100
          description: >-
            A limit on the number of objects to be returned. Limit can range
            between 1 and 100, and the default is 10.
        - in: query
          name: page
          schema:
            type: string
          description: >-
            A cursor for pagination across multiple pages of results. Don't
            include this parameter on the first call. Use the next_page value
            returned in a previous response to request subsequent results.
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/main_module_public_api.plansResDTO'
          description: >-
            A dictionary with a data property that contains an array of up to
            limit plans. If no plans match the query, the resulting array will
            be empty.
        '400':
          description: Bad Request — missing or invalid query parameter
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    main_module_public_api.plansResDTO:
      type: object
      properties:
        object:
          type: string
          enum:
            - plans
          description: String representing the object's type. Value is always `plans`.
          example: plans
        total_count:
          description: >-
            The accurate total number of records matching the query (not capped
            at 10,000). Returned alongside the cursor pagination fields.
          example: 142
          type: integer
        url:
          type: string
          description: The URL for accessing this list.
          example: /v1/plans
        data:
          type: array
          items:
            $ref: '#/components/schemas/core_model.PlanResDTO'
          description: An array of plan objects.
        has_more:
          type: boolean
          description: Whether or not there are more elements available after this set.
          example: false
        next_page:
          type: string
          description: >-
            A cursor for use in pagination. If has_more is true, you can pass
            the value of next_page to a subsequent call to fetch the next page
            of results.
          example: null
          nullable: true
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - api_error
                - invalid_request_error
                - authentication_error
              description: The type of error returned.
              example: invalid_request_error
            code:
              type: string
              description: >-
                For some errors that could be handled programmatically, a short
                string indicating the error code reported.
              example: parameter_missing
            message:
              type: string
              description: A human-readable message providing more details about the error.
              example: 'Missing required parameter: email'
            param:
              type: string
              description: >-
                If the error is parameter-specific, the parameter related to the
                error.
              example: email
          required:
            - type
            - message
    core_model.PlanResDTO:
      properties:
        id:
          description: Unique identifier for the plan
          example: price_1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
          type: string
          x-order: '0'
        archived_at:
          description: The date and time at which the plan was archived in UTC format
          example: '2025-06-01T10:00:00Z'
          type: string
        interval:
          description: Type of the billing period
          enum:
            - days
            - months
            - years
          type: string
          x-order: '5'
        interval_count:
          description: Number of billing periods per cycle
          example: 1
          type: integer
          x-order: '6'
        name:
          description: Display name of the plan
          example: Pro Plan
          type: string
          x-order: '3'
        price:
          allOf:
            - $ref: '#/components/schemas/core_model.PlanPriceDetails'
          description: Pricing details for the plan
          type: object
          x-order: '7'
        tax:
          allOf:
            - $ref: '#/components/schemas/core_model.PlanTax'
          description: Taxes information
          type: object
          x-order: '10'
        trial_interval:
          description: Type of trial period
          enum:
            - days
            - months
            - years
          type: string
          x-order: '8'
        trial_interval_count:
          description: Length of the trial period
          example: 14
          type: integer
          x-order: '9'
        trial_price:
          allOf:
            - $ref: '#/components/schemas/core_model.PlanPriceDetails'
          description: Trial pricing details
          type: object
        type:
          description: Type of the plan
          enum:
            - recurring
            - one-off
          example: recurring
          type: string
          x-order: '4'
        updated_at:
          description: The date and time of the last plan update in UTC format
          example: '2025-05-27T10:00:00Z'
          type: string
          x-order: '2'
      type: object
    core_model.PlanPriceDetails:
      properties:
        countries:
          items:
            $ref: '#/components/schemas/core_model.PlanCountriesPrice'
          type: array
        default:
          $ref: '#/components/schemas/core_model.PlanPrice'
      type: object
    core_model.PlanTax:
      properties:
        collect_tax:
          allOf:
            - $ref: '#/components/schemas/core_model.PlanTaxCollection'
          example: DEFAULT
          type: object
      type: object
    core_model.PlanCountriesPrice:
      properties:
        countries:
          description: List of country codes (ISO 3166-1 alpha-2) where this price applies
          items:
            enum:
              - AD
              - AE
              - AF
              - AG
              - AL
              - AM
              - AO
              - AR
              - AS
              - AT
              - AU
              - AW
              - AX
              - AZ
              - BA
              - BB
              - BD
              - BE
              - BF
              - BG
              - BH
              - BI
              - BJ
              - BL
              - BM
              - BN
              - BO
              - BQ
              - BR
              - BS
              - BT
              - BW
              - BY
              - BZ
              - CA
              - CD
              - CF
              - CG
              - CH
              - CI
              - CL
              - CM
              - CN
              - CO
              - CR
              - CU
              - CU-P
              - CV
              - CW
              - CY
              - CZ
              - DE
              - DJ
              - DK
              - DM
              - DO
              - DZ
              - EC
              - EE
              - EG
              - ER
              - ES
              - ET
              - FI
              - FJ
              - FK
              - FM
              - FR
              - GA
              - GB
              - GD
              - GE
              - GF
              - GG
              - GH
              - GI
              - GL
              - GM
              - GN
              - GP
              - GQ
              - GR
              - GT
              - GU
              - GW
              - GY
              - HK
              - HN
              - HR
              - HT
              - HU
              - ID
              - IE
              - IL
              - IM
              - IN
              - IQ
              - IR
              - IS
              - IT
              - JE
              - JM
              - JO
              - JP
              - KE
              - KG
              - KH
              - KI
              - KM
              - KN
              - KP
              - KR
              - KW
              - KY
              - KZ
              - LA
              - LB
              - LC
              - LI
              - LK
              - LR
              - LS
              - LT
              - LU
              - LV
              - LY
              - MA
              - MC
              - MD
              - ME
              - MF
              - MG
              - MH
              - MK
              - ML
              - MM
              - MN
              - MO
              - MP
              - MQ
              - MR
              - MS
              - MT
              - MU
              - MV
              - MW
              - MX
              - MY
              - MZ
              - NA
              - NC
              - NE
              - NG
              - NI
              - NL
              - 'NO'
              - NP
              - NR
              - NU
              - NZ
              - OM
              - PA
              - PE
              - PF
              - PG
              - PH
              - PK
              - PL
              - PM
              - PN
              - PR
              - PS
              - PT
              - PW
              - PY
              - QA
              - RE
              - RO
              - RS
              - RU
              - RW
              - SA
              - SB
              - SC
              - SD
              - SE
              - SG
              - SH
              - SI
              - SK
              - SL
              - SM
              - SN
              - SO
              - SR
              - SS
              - ST
              - SV
              - SX
              - SY
              - SZ
              - TC
              - TD
              - TG
              - TH
              - TJ
              - TK
              - TL
              - TM
              - TN
              - TO
              - TR
              - TT
              - TV
              - TW
              - TZ
              - UA
              - UG
              - US
              - UY
              - UZ
              - VA
              - VC
              - VE
              - VG
              - VI
              - VN
              - VU
              - WF
              - WS
              - XK
              - YE
              - YT
              - ZA
              - ZM
              - ZW
            type: string
          type: array
        price:
          $ref: '#/components/schemas/core_model.PlanPrice'
      type: object
    core_model.PlanPrice:
      properties:
        amount:
          description: Price amount  in minor units
          example: 1999
          type: integer
        currency:
          description: >-
            The 3-letter currency code in ISO 4217 format. e.g. use USD for US
            dollars
          enum:
            - AED
            - AFN
            - ALL
            - AMD
            - AOA
            - ARS
            - AUD
            - AWG
            - AZN
            - BAM
            - BBD
            - BDT
            - BGN
            - BHD
            - BIF
            - BMD
            - BND
            - BOB
            - BRL
            - BSD
            - BTN
            - BWP
            - BYN
            - BZD
            - CAD
            - CDF
            - CHF
            - CLP
            - CNY
            - COP
            - CRC
            - CUC
            - CUP
            - CVE
            - CZK
            - DJF
            - DKK
            - DOP
            - DZD
            - EGP
            - ERN
            - ETB
            - EUR
            - FJD
            - FKP
            - GBP
            - GEL
            - GHS
            - GIP
            - GMD
            - GNF
            - GTQ
            - GYD
            - HKD
            - HNL
            - HTG
            - HUF
            - IDR
            - ILS
            - IMP
            - INR
            - IQD
            - IRR
            - ISK
            - JEP
            - JMD
            - JOD
            - JPY
            - KES
            - KGS
            - KHR
            - KMF
            - KPW
            - KRW
            - KWD
            - KYD
            - KZT
            - LAK
            - LBP
            - LKR
            - LRD
            - LSL
            - LYD
            - MAD
            - MDL
            - MGA
            - MKD
            - MMK
            - MNT
            - MOP
            - MRU
            - MUR
            - MVR
            - MWK
            - MXN
            - MYR
            - MZN
            - NAD
            - NGN
            - NIO
            - NOK
            - NPR
            - NZD
            - OMR
            - PAB
            - PEN
            - PGK
            - PHP
            - PKR
            - PLN
            - PYG
            - QAR
            - RON
            - RSD
            - RUB
            - RWF
            - SAR
            - SBD
            - SCR
            - SDG
            - SEK
            - SGD
            - SHP
            - SLE
            - SOS
            - SRD
            - SSP
            - STD
            - STN
            - SVC
            - SYP
            - SZL
            - THB
            - TJS
            - TMT
            - TND
            - TOP
            - TRY
            - TTD
            - TWD
            - TZS
            - BOV
            - COU
            - CHE
            - CHW
            - MXV
            - UGX
            - VES
            - VND
            - VUV
            - XAF
            - XCD
            - XCG
            - XOF
            - XPF
            - YER
            - USD
          example: AED
          type: string
      type: object
    core_model.PlanTaxCollection:
      enum:
        - DEFAULT
        - COLLECT
        - DONT_COLLECT
      type: string
      x-enum-varnames:
        - PlanTaxCollectionDEFAULT
        - PlanTaxCollectionCOLLECT
        - PlanTaxCollectionDONTCOLLECT

````